@azure-rest/developer-devcenter 1.0.0-alpha.20221018.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,126 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ const responseMap = {
4
+ "GET /projects": ["200"],
5
+ "GET /projects/{projectName}": ["200"],
6
+ "GET /devboxes": ["200"],
7
+ "GET /users/{userId}/devboxes": ["200"],
8
+ "GET /projects/{projectName}/pools": ["200"],
9
+ "GET /projects/{projectName}/pools/{poolName}": ["200"],
10
+ "GET /projects/{projectName}/pools/{poolName}/schedules": ["200"],
11
+ "GET /projects/{projectName}/pools/{poolName}/schedules/{scheduleName}": ["200"],
12
+ "GET /projects/{projectName}/users/{userId}/devboxes": ["200"],
13
+ "GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}": ["200"],
14
+ "PUT /projects/{projectName}/users/{userId}/devboxes/{devBoxName}": ["200", "201"],
15
+ "DELETE /projects/{projectName}/users/{userId}/devboxes/{devBoxName}": ["200", "202", "204"],
16
+ "POST /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start": ["200", "202"],
17
+ "GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start": ["200", "202"],
18
+ "POST /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop": ["200", "202"],
19
+ "GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop": ["200", "202"],
20
+ "GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}/remoteConnection": ["200"],
21
+ "GET /projects/{projectName}/environments": ["200"],
22
+ "GET /projects/{projectName}/users/{userId}/environments": ["200"],
23
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}": ["200"],
24
+ "PUT /projects/{projectName}/users/{userId}/environments/{environmentName}": ["200", "201"],
25
+ "PATCH /projects/{projectName}/users/{userId}/environments/{environmentName}": ["200"],
26
+ "DELETE /projects/{projectName}/users/{userId}/environments/{environmentName}": [
27
+ "200",
28
+ "202",
29
+ "204",
30
+ ],
31
+ "POST /projects/{projectName}/users/{userId}/environments/{environmentName}:deploy": [
32
+ "200",
33
+ "202",
34
+ ],
35
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}:deploy": [
36
+ "200",
37
+ "202",
38
+ ],
39
+ "POST /projects/{projectName}/users/{userId}/environments/{environmentName}:delete": [
40
+ "200",
41
+ "202",
42
+ ],
43
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}:delete": [
44
+ "200",
45
+ "202",
46
+ ],
47
+ "POST /projects/{projectName}/users/{userId}/environments/{environmentName}:custom": [
48
+ "200",
49
+ "202",
50
+ ],
51
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}:custom": [
52
+ "200",
53
+ "202",
54
+ ],
55
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}/artifacts": ["200"],
56
+ "GET /projects/{projectName}/users/{userId}/environments/{environmentName}/artifacts/{artifactPath}": [
57
+ "200",
58
+ ],
59
+ "GET /projects/{projectName}/catalogItems": ["200"],
60
+ "GET /projects/{projectName}/catalogItems/{catalogItemId}": ["200"],
61
+ "GET /projects/{projectName}/catalogItems/{catalogItemId}/versions": ["200"],
62
+ "GET /projects/{projectName}/catalogItems/{catalogItemId}/versions/{version}": ["200"],
63
+ "GET /projects/{projectName}/environmentTypes": ["200"],
64
+ };
65
+ export function isUnexpected(response) {
66
+ const lroOriginal = response.headers["x-ms-original-url"];
67
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
68
+ const method = response.request.method;
69
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
70
+ if (!pathDetails) {
71
+ pathDetails = geParametrizedPathSuccess(method, url.pathname);
72
+ }
73
+ return !pathDetails.includes(response.status);
74
+ }
75
+ function geParametrizedPathSuccess(method, path) {
76
+ var _a, _b;
77
+ const pathParts = path.split("/");
78
+ // Iterate the responseMap to find a match
79
+ for (const [key, value] of Object.entries(responseMap)) {
80
+ // Extracting the path from the map key which is in format
81
+ // GET /path/foo
82
+ if (!key.startsWith(method)) {
83
+ continue;
84
+ }
85
+ const candidatePath = getPathFromMapKey(key);
86
+ // Get each part of the url path
87
+ const candidateParts = candidatePath.split("/");
88
+ // If the candidate and actual paths don't match in size
89
+ // we move on to the next candidate path
90
+ if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
91
+ // track if we have found a match to return the values found.
92
+ let found = true;
93
+ for (let i = 0; i < candidateParts.length; i++) {
94
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.endsWith("}"))) {
95
+ // If the current part of the candidate is a "template" part
96
+ // it is a match with the actual path part on hand
97
+ // skip as the parameterized part can match anything
98
+ continue;
99
+ }
100
+ // If the candidate part is not a template and
101
+ // the parts don't match mark the candidate as not found
102
+ // to move on with the next candidate path.
103
+ if (candidateParts[i] !== pathParts[i]) {
104
+ found = false;
105
+ break;
106
+ }
107
+ }
108
+ // We finished evaluating the current candidate parts
109
+ // if all parts matched we return the success values form
110
+ // the path mapping.
111
+ if (found) {
112
+ return value;
113
+ }
114
+ }
115
+ }
116
+ // No match was found, return an empty array.
117
+ return [];
118
+ }
119
+ function hasParametrizedPath(path) {
120
+ return path.includes("/{");
121
+ }
122
+ function getPathFromMapKey(mapKey) {
123
+ const pathStart = mapKey.indexOf("/");
124
+ return mapKey.slice(pathStart);
125
+ }
126
+ //# sourceMappingURL=isUnexpected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8ElC,MAAM,WAAW,GAA6B;IAC5C,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,8CAA8C,EAAE,CAAC,KAAK,CAAC;IACvD,wDAAwD,EAAE,CAAC,KAAK,CAAC;IACjE,uEAAuE,EAAE,CAAC,KAAK,CAAC;IAChF,qDAAqD,EAAE,CAAC,KAAK,CAAC;IAC9D,kEAAkE,EAAE,CAAC,KAAK,CAAC;IAC3E,kEAAkE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAClF,qEAAqE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAC5F,yEAAyE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACzF,wEAAwE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACxF,wEAAwE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACxF,uEAAuE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACvF,mFAAmF,EAAE,CAAC,KAAK,CAAC;IAC5F,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,yDAAyD,EAAE,CAAC,KAAK,CAAC;IAClE,2EAA2E,EAAE,CAAC,KAAK,CAAC;IACpF,2EAA2E,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC3F,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,8EAA8E,EAAE;QAC9E,KAAK;QACL,KAAK;QACL,KAAK;KACN;IACD,mFAAmF,EAAE;QACnF,KAAK;QACL,KAAK;KACN;IACD,kFAAkF,EAAE;QAClF,KAAK;QACL,KAAK;KACN;IACD,mFAAmF,EAAE;QACnF,KAAK;QACL,KAAK;KACN;IACD,kFAAkF,EAAE;QAClF,KAAK;QACL,KAAK;KACN;IACD,mFAAmF,EAAE;QACnF,KAAK;QACL,KAAK;KACN;IACD,kFAAkF,EAAE;QAClF,KAAK;QACL,KAAK;KACN;IACD,qFAAqF,EAAE,CAAC,KAAK,CAAC;IAC9F,oGAAoG,EAAE;QACpG,KAAK;KACN;IACD,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,0DAA0D,EAAE,CAAC,KAAK,CAAC;IACnE,mEAAmE,EAAE,CAAC,KAAK,CAAC;IAC5E,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,8CAA8C,EAAE,CAAC,KAAK,CAAC;CACxD,CAAC;AA4IF,MAAM,UAAU,YAAY,CAC1B,QAyEmD;IAiCnD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,yBAAyB,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;KAC/D;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAc,EAAE,IAAY;;IAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACtD,0DAA0D;QAC1D,gBAAgB;QAChB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAC3B,SAAS;SACV;QACD,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,wDAAwD;QACxD,wCAAwC;QACxC,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAC1E,6DAA6D;YAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAI,CAAA,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,UAAU,CAAC,GAAG,CAAC,MAAI,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,QAAQ,CAAC,GAAG,CAAC,CAAA,EAAE;oBAC1E,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DevCenterListProjects200Response,\n DevCenterListProjectsDefaultResponse,\n DevCenterGetProject200Response,\n DevCenterGetProjectDefaultResponse,\n DevCenterListAllDevBoxes200Response,\n DevCenterListAllDevBoxesDefaultResponse,\n DevCenterListAllDevBoxesByUser200Response,\n DevCenterListAllDevBoxesByUserDefaultResponse,\n DevBoxesListPools200Response,\n DevBoxesListPoolsDefaultResponse,\n DevBoxesGetPool200Response,\n DevBoxesGetPoolDefaultResponse,\n DevBoxesListSchedulesByPool200Response,\n DevBoxesListSchedulesByPoolDefaultResponse,\n DevBoxesGetScheduleByPool200Response,\n DevBoxesGetScheduleByPoolDefaultResponse,\n DevBoxesListDevBoxesByUser200Response,\n DevBoxesListDevBoxesByUserDefaultResponse,\n DevBoxesGetDevBoxByUser200Response,\n DevBoxesGetDevBoxByUserDefaultResponse,\n DevBoxesCreateDevBox200Response,\n DevBoxesCreateDevBox201Response,\n DevBoxesCreateDevBoxDefaultResponse,\n DevBoxesDeleteDevBox200Response,\n DevBoxesDeleteDevBox202Response,\n DevBoxesDeleteDevBox204Response,\n DevBoxesDeleteDevBoxDefaultResponse,\n DevBoxesStartDevBox200Response,\n DevBoxesStartDevBox202Response,\n DevBoxesStartDevBoxDefaultResponse,\n DevBoxesStopDevBox200Response,\n DevBoxesStopDevBox202Response,\n DevBoxesStopDevBoxDefaultResponse,\n DevBoxesGetRemoteConnection200Response,\n DevBoxesGetRemoteConnectionDefaultResponse,\n EnvironmentsListEnvironments200Response,\n EnvironmentsListEnvironmentsDefaultResponse,\n EnvironmentsListEnvironmentsByUser200Response,\n EnvironmentsListEnvironmentsByUserDefaultResponse,\n EnvironmentsGetEnvironmentByUser200Response,\n EnvironmentsGetEnvironmentByUserDefaultResponse,\n EnvironmentsCreateOrUpdateEnvironment200Response,\n EnvironmentsCreateOrUpdateEnvironment201Response,\n EnvironmentsCreateOrUpdateEnvironmentDefaultResponse,\n EnvironmentsUpdateEnvironment200Response,\n EnvironmentsUpdateEnvironmentDefaultResponse,\n EnvironmentsDeleteEnvironment200Response,\n EnvironmentsDeleteEnvironment202Response,\n EnvironmentsDeleteEnvironment204Response,\n EnvironmentsDeleteEnvironmentDefaultResponse,\n EnvironmentsDeployEnvironmentAction200Response,\n EnvironmentsDeployEnvironmentAction202Response,\n EnvironmentsDeployEnvironmentActionDefaultResponse,\n EnvironmentsDeleteEnvironmentAction200Response,\n EnvironmentsDeleteEnvironmentAction202Response,\n EnvironmentsDeleteEnvironmentActionDefaultResponse,\n EnvironmentsCustomEnvironmentAction200Response,\n EnvironmentsCustomEnvironmentAction202Response,\n EnvironmentsCustomEnvironmentActionDefaultResponse,\n EnvironmentsListArtifactsByEnvironment200Response,\n EnvironmentsListArtifactsByEnvironmentDefaultResponse,\n EnvironmentsListArtifactsByEnvironmentAndPath200Response,\n EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse,\n EnvironmentsListCatalogItems200Response,\n EnvironmentsListCatalogItemsDefaultResponse,\n EnvironmentsGetCatalogItem200Response,\n EnvironmentsGetCatalogItemDefaultResponse,\n EnvironmentsListCatalogItemVersions200Response,\n EnvironmentsListCatalogItemVersionsDefaultResponse,\n EnvironmentsGetCatalogItemVersion200Response,\n EnvironmentsGetCatalogItemVersionDefaultResponse,\n EnvironmentsListEnvironmentTypes200Response,\n EnvironmentsListEnvironmentTypesDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /projects\": [\"200\"],\n \"GET /projects/{projectName}\": [\"200\"],\n \"GET /devboxes\": [\"200\"],\n \"GET /users/{userId}/devboxes\": [\"200\"],\n \"GET /projects/{projectName}/pools\": [\"200\"],\n \"GET /projects/{projectName}/pools/{poolName}\": [\"200\"],\n \"GET /projects/{projectName}/pools/{poolName}/schedules\": [\"200\"],\n \"GET /projects/{projectName}/pools/{poolName}/schedules/{scheduleName}\": [\"200\"],\n \"GET /projects/{projectName}/users/{userId}/devboxes\": [\"200\"],\n \"GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}\": [\"200\"],\n \"PUT /projects/{projectName}/users/{userId}/devboxes/{devBoxName}\": [\"200\", \"201\"],\n \"DELETE /projects/{projectName}/users/{userId}/devboxes/{devBoxName}\": [\"200\", \"202\", \"204\"],\n \"POST /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start\": [\"200\", \"202\"],\n \"GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:start\": [\"200\", \"202\"],\n \"POST /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop\": [\"200\", \"202\"],\n \"GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}:stop\": [\"200\", \"202\"],\n \"GET /projects/{projectName}/users/{userId}/devboxes/{devBoxName}/remoteConnection\": [\"200\"],\n \"GET /projects/{projectName}/environments\": [\"200\"],\n \"GET /projects/{projectName}/users/{userId}/environments\": [\"200\"],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}\": [\"200\"],\n \"PUT /projects/{projectName}/users/{userId}/environments/{environmentName}\": [\"200\", \"201\"],\n \"PATCH /projects/{projectName}/users/{userId}/environments/{environmentName}\": [\"200\"],\n \"DELETE /projects/{projectName}/users/{userId}/environments/{environmentName}\": [\n \"200\",\n \"202\",\n \"204\",\n ],\n \"POST /projects/{projectName}/users/{userId}/environments/{environmentName}:deploy\": [\n \"200\",\n \"202\",\n ],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}:deploy\": [\n \"200\",\n \"202\",\n ],\n \"POST /projects/{projectName}/users/{userId}/environments/{environmentName}:delete\": [\n \"200\",\n \"202\",\n ],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}:delete\": [\n \"200\",\n \"202\",\n ],\n \"POST /projects/{projectName}/users/{userId}/environments/{environmentName}:custom\": [\n \"200\",\n \"202\",\n ],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}:custom\": [\n \"200\",\n \"202\",\n ],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}/artifacts\": [\"200\"],\n \"GET /projects/{projectName}/users/{userId}/environments/{environmentName}/artifacts/{artifactPath}\": [\n \"200\",\n ],\n \"GET /projects/{projectName}/catalogItems\": [\"200\"],\n \"GET /projects/{projectName}/catalogItems/{catalogItemId}\": [\"200\"],\n \"GET /projects/{projectName}/catalogItems/{catalogItemId}/versions\": [\"200\"],\n \"GET /projects/{projectName}/catalogItems/{catalogItemId}/versions/{version}\": [\"200\"],\n \"GET /projects/{projectName}/environmentTypes\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: DevCenterListProjects200Response | DevCenterListProjectsDefaultResponse\n): response is DevCenterListProjectsDefaultResponse;\nexport function isUnexpected(\n response: DevCenterGetProject200Response | DevCenterGetProjectDefaultResponse\n): response is DevCenterGetProjectDefaultResponse;\nexport function isUnexpected(\n response: DevCenterListAllDevBoxes200Response | DevCenterListAllDevBoxesDefaultResponse\n): response is DevCenterListAllDevBoxesDefaultResponse;\nexport function isUnexpected(\n response:\n | DevCenterListAllDevBoxesByUser200Response\n | DevCenterListAllDevBoxesByUserDefaultResponse\n): response is DevCenterListAllDevBoxesByUserDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesListPools200Response | DevBoxesListPoolsDefaultResponse\n): response is DevBoxesListPoolsDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesGetPool200Response | DevBoxesGetPoolDefaultResponse\n): response is DevBoxesGetPoolDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesListSchedulesByPool200Response | DevBoxesListSchedulesByPoolDefaultResponse\n): response is DevBoxesListSchedulesByPoolDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesGetScheduleByPool200Response | DevBoxesGetScheduleByPoolDefaultResponse\n): response is DevBoxesGetScheduleByPoolDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesListDevBoxesByUser200Response | DevBoxesListDevBoxesByUserDefaultResponse\n): response is DevBoxesListDevBoxesByUserDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesGetDevBoxByUser200Response | DevBoxesGetDevBoxByUserDefaultResponse\n): response is DevBoxesGetDevBoxByUserDefaultResponse;\nexport function isUnexpected(\n response:\n | DevBoxesCreateDevBox200Response\n | DevBoxesCreateDevBox201Response\n | DevBoxesCreateDevBoxDefaultResponse\n): response is DevBoxesCreateDevBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | DevBoxesDeleteDevBox200Response\n | DevBoxesDeleteDevBox202Response\n | DevBoxesDeleteDevBox204Response\n | DevBoxesDeleteDevBoxDefaultResponse\n): response is DevBoxesDeleteDevBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | DevBoxesStartDevBox200Response\n | DevBoxesStartDevBox202Response\n | DevBoxesStartDevBoxDefaultResponse\n): response is DevBoxesStartDevBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | DevBoxesStopDevBox200Response\n | DevBoxesStopDevBox202Response\n | DevBoxesStopDevBoxDefaultResponse\n): response is DevBoxesStopDevBoxDefaultResponse;\nexport function isUnexpected(\n response: DevBoxesGetRemoteConnection200Response | DevBoxesGetRemoteConnectionDefaultResponse\n): response is DevBoxesGetRemoteConnectionDefaultResponse;\nexport function isUnexpected(\n response: EnvironmentsListEnvironments200Response | EnvironmentsListEnvironmentsDefaultResponse\n): response is EnvironmentsListEnvironmentsDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsListEnvironmentsByUser200Response\n | EnvironmentsListEnvironmentsByUserDefaultResponse\n): response is EnvironmentsListEnvironmentsByUserDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsGetEnvironmentByUser200Response\n | EnvironmentsGetEnvironmentByUserDefaultResponse\n): response is EnvironmentsGetEnvironmentByUserDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsCreateOrUpdateEnvironment200Response\n | EnvironmentsCreateOrUpdateEnvironment201Response\n | EnvironmentsCreateOrUpdateEnvironmentDefaultResponse\n): response is EnvironmentsCreateOrUpdateEnvironmentDefaultResponse;\nexport function isUnexpected(\n response: EnvironmentsUpdateEnvironment200Response | EnvironmentsUpdateEnvironmentDefaultResponse\n): response is EnvironmentsUpdateEnvironmentDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsDeleteEnvironment200Response\n | EnvironmentsDeleteEnvironment202Response\n | EnvironmentsDeleteEnvironment204Response\n | EnvironmentsDeleteEnvironmentDefaultResponse\n): response is EnvironmentsDeleteEnvironmentDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsDeployEnvironmentAction200Response\n | EnvironmentsDeployEnvironmentAction202Response\n | EnvironmentsDeployEnvironmentActionDefaultResponse\n): response is EnvironmentsDeployEnvironmentActionDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsDeleteEnvironmentAction200Response\n | EnvironmentsDeleteEnvironmentAction202Response\n | EnvironmentsDeleteEnvironmentActionDefaultResponse\n): response is EnvironmentsDeleteEnvironmentActionDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsCustomEnvironmentAction200Response\n | EnvironmentsCustomEnvironmentAction202Response\n | EnvironmentsCustomEnvironmentActionDefaultResponse\n): response is EnvironmentsCustomEnvironmentActionDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsListArtifactsByEnvironment200Response\n | EnvironmentsListArtifactsByEnvironmentDefaultResponse\n): response is EnvironmentsListArtifactsByEnvironmentDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsListArtifactsByEnvironmentAndPath200Response\n | EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse\n): response is EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse;\nexport function isUnexpected(\n response: EnvironmentsListCatalogItems200Response | EnvironmentsListCatalogItemsDefaultResponse\n): response is EnvironmentsListCatalogItemsDefaultResponse;\nexport function isUnexpected(\n response: EnvironmentsGetCatalogItem200Response | EnvironmentsGetCatalogItemDefaultResponse\n): response is EnvironmentsGetCatalogItemDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsListCatalogItemVersions200Response\n | EnvironmentsListCatalogItemVersionsDefaultResponse\n): response is EnvironmentsListCatalogItemVersionsDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsGetCatalogItemVersion200Response\n | EnvironmentsGetCatalogItemVersionDefaultResponse\n): response is EnvironmentsGetCatalogItemVersionDefaultResponse;\nexport function isUnexpected(\n response:\n | EnvironmentsListEnvironmentTypes200Response\n | EnvironmentsListEnvironmentTypesDefaultResponse\n): response is EnvironmentsListEnvironmentTypesDefaultResponse;\nexport function isUnexpected(\n response:\n | DevCenterListProjects200Response\n | DevCenterListProjectsDefaultResponse\n | DevCenterGetProject200Response\n | DevCenterGetProjectDefaultResponse\n | DevCenterListAllDevBoxes200Response\n | DevCenterListAllDevBoxesDefaultResponse\n | DevCenterListAllDevBoxesByUser200Response\n | DevCenterListAllDevBoxesByUserDefaultResponse\n | DevBoxesListPools200Response\n | DevBoxesListPoolsDefaultResponse\n | DevBoxesGetPool200Response\n | DevBoxesGetPoolDefaultResponse\n | DevBoxesListSchedulesByPool200Response\n | DevBoxesListSchedulesByPoolDefaultResponse\n | DevBoxesGetScheduleByPool200Response\n | DevBoxesGetScheduleByPoolDefaultResponse\n | DevBoxesListDevBoxesByUser200Response\n | DevBoxesListDevBoxesByUserDefaultResponse\n | DevBoxesGetDevBoxByUser200Response\n | DevBoxesGetDevBoxByUserDefaultResponse\n | DevBoxesCreateDevBox200Response\n | DevBoxesCreateDevBox201Response\n | DevBoxesCreateDevBoxDefaultResponse\n | DevBoxesDeleteDevBox200Response\n | DevBoxesDeleteDevBox202Response\n | DevBoxesDeleteDevBox204Response\n | DevBoxesDeleteDevBoxDefaultResponse\n | DevBoxesStartDevBox200Response\n | DevBoxesStartDevBox202Response\n | DevBoxesStartDevBoxDefaultResponse\n | DevBoxesStopDevBox200Response\n | DevBoxesStopDevBox202Response\n | DevBoxesStopDevBoxDefaultResponse\n | DevBoxesGetRemoteConnection200Response\n | DevBoxesGetRemoteConnectionDefaultResponse\n | EnvironmentsListEnvironments200Response\n | EnvironmentsListEnvironmentsDefaultResponse\n | EnvironmentsListEnvironmentsByUser200Response\n | EnvironmentsListEnvironmentsByUserDefaultResponse\n | EnvironmentsGetEnvironmentByUser200Response\n | EnvironmentsGetEnvironmentByUserDefaultResponse\n | EnvironmentsCreateOrUpdateEnvironment200Response\n | EnvironmentsCreateOrUpdateEnvironment201Response\n | EnvironmentsCreateOrUpdateEnvironmentDefaultResponse\n | EnvironmentsUpdateEnvironment200Response\n | EnvironmentsUpdateEnvironmentDefaultResponse\n | EnvironmentsDeleteEnvironment200Response\n | EnvironmentsDeleteEnvironment202Response\n | EnvironmentsDeleteEnvironment204Response\n | EnvironmentsDeleteEnvironmentDefaultResponse\n | EnvironmentsDeployEnvironmentAction200Response\n | EnvironmentsDeployEnvironmentAction202Response\n | EnvironmentsDeployEnvironmentActionDefaultResponse\n | EnvironmentsDeleteEnvironmentAction200Response\n | EnvironmentsDeleteEnvironmentAction202Response\n | EnvironmentsDeleteEnvironmentActionDefaultResponse\n | EnvironmentsCustomEnvironmentAction200Response\n | EnvironmentsCustomEnvironmentAction202Response\n | EnvironmentsCustomEnvironmentActionDefaultResponse\n | EnvironmentsListArtifactsByEnvironment200Response\n | EnvironmentsListArtifactsByEnvironmentDefaultResponse\n | EnvironmentsListArtifactsByEnvironmentAndPath200Response\n | EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse\n | EnvironmentsListCatalogItems200Response\n | EnvironmentsListCatalogItemsDefaultResponse\n | EnvironmentsGetCatalogItem200Response\n | EnvironmentsGetCatalogItemDefaultResponse\n | EnvironmentsListCatalogItemVersions200Response\n | EnvironmentsListCatalogItemVersionsDefaultResponse\n | EnvironmentsGetCatalogItemVersion200Response\n | EnvironmentsGetCatalogItemVersionDefaultResponse\n | EnvironmentsListEnvironmentTypes200Response\n | EnvironmentsListEnvironmentTypesDefaultResponse\n): response is\n | DevCenterListProjectsDefaultResponse\n | DevCenterGetProjectDefaultResponse\n | DevCenterListAllDevBoxesDefaultResponse\n | DevCenterListAllDevBoxesByUserDefaultResponse\n | DevBoxesListPoolsDefaultResponse\n | DevBoxesGetPoolDefaultResponse\n | DevBoxesListSchedulesByPoolDefaultResponse\n | DevBoxesGetScheduleByPoolDefaultResponse\n | DevBoxesListDevBoxesByUserDefaultResponse\n | DevBoxesGetDevBoxByUserDefaultResponse\n | DevBoxesCreateDevBoxDefaultResponse\n | DevBoxesDeleteDevBoxDefaultResponse\n | DevBoxesStartDevBoxDefaultResponse\n | DevBoxesStopDevBoxDefaultResponse\n | DevBoxesGetRemoteConnectionDefaultResponse\n | EnvironmentsListEnvironmentsDefaultResponse\n | EnvironmentsListEnvironmentsByUserDefaultResponse\n | EnvironmentsGetEnvironmentByUserDefaultResponse\n | EnvironmentsCreateOrUpdateEnvironmentDefaultResponse\n | EnvironmentsUpdateEnvironmentDefaultResponse\n | EnvironmentsDeleteEnvironmentDefaultResponse\n | EnvironmentsDeployEnvironmentActionDefaultResponse\n | EnvironmentsDeleteEnvironmentActionDefaultResponse\n | EnvironmentsCustomEnvironmentActionDefaultResponse\n | EnvironmentsListArtifactsByEnvironmentDefaultResponse\n | EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse\n | EnvironmentsListCatalogItemsDefaultResponse\n | EnvironmentsGetCatalogItemDefaultResponse\n | EnvironmentsListCatalogItemVersionsDefaultResponse\n | EnvironmentsGetCatalogItemVersionDefaultResponse\n | EnvironmentsListEnvironmentTypesDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** Hardware specifications for the Dev Box. */\nexport interface HardwareProfile {\n /** The name of the SKU */\n skuName?: string;\n /** The number of vCPUs available for the Dev Box. */\n vCPUs?: number;\n /** The amount of memory available for the Dev Box. */\n memoryGB?: number;\n}\n\n/** Storage settings for the Dev Box's disks */\nexport interface StorageProfile {\n /** Settings for the operating system disk. */\n osDisk?: OSDisk;\n}\n\n/** Settings for the operating system disk. */\nexport interface OSDisk {\n /** The size of the OS Disk in gigabytes. */\n diskSizeGB?: number;\n}\n\n/** Specifies information about the image used */\nexport interface ImageReference {\n /** The name of the image used. */\n name?: string;\n /** The version of the image. */\n version?: string;\n /** The operating system of the image. */\n operatingSystem?: string;\n /** The operating system build number of the image. */\n osBuildNumber?: string;\n /** The datetime that the backing image version was published. */\n publishedDate?: Date | string;\n}\n\n/** A DevBox Dev Box */\nexport interface DevBox {\n /** Display name for the Dev Box */\n name?: string;\n /** Name of the project this Dev Box belongs to */\n projectName?: string;\n /** The name of the Dev Box pool this machine belongs to. */\n poolName: string;\n /** The current provisioning state of the Dev Box. */\n provisioningState?: string;\n /** The current action state of the Dev Box. This is state is based on previous action performed by user. */\n actionState?: string;\n /** The current power state of the Dev Box. */\n powerState?: \"Unknown\" | \"Deallocated\" | \"PoweredOff\" | \"Running\" | \"Hibernated\";\n /** A unique identifier for the Dev Box. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */\n uniqueId?: string;\n /** Provisioning or action error details. Populated only for error states. */\n errorDetails?: ProvisioningError;\n /** Azure region where this Dev Box is located. This will be the same region as the Virtual Network it is attached to. */\n location?: string;\n /** The operating system type of this Dev Box. */\n osType?: \"Windows\";\n /** User identifier of the user this vm is assigned to. */\n user?: string;\n /** Information about the Dev Box's hardware resources */\n hardwareProfile?: HardwareProfile;\n /** Storage settings for this Dev Box */\n storageProfile?: StorageProfile;\n /** Information about the image used for this Dev Box */\n imageReference?: ImageReference;\n /** Creation time of this Dev Box */\n createdTime?: Date | string;\n /** Indicates whether the owner of the Dev Box is a local administrator. */\n localAdministrator?: \"Enabled\" | \"Disabled\";\n}\n\n/** Error details */\nexport interface ProvisioningError {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n}\n\n/** Properties of an environment. */\nexport interface Environment extends EnvironmentUpdateProperties {\n /** Environment name. */\n name?: string;\n /** Environment type. */\n environmentType: string;\n /** Identifier of the owner of this Environment. */\n owner?: string;\n /** The provisioning state of the environment. */\n provisioningState?: string;\n /** The identifier of the resource group containing the environment's resources. */\n resourceGroupId?: string;\n}\n\n/** Properties of an environment. These properties can be updated after the resource has been created. */\nexport interface EnvironmentUpdateProperties {\n /** Description of the Environment. */\n description?: string;\n /** Name of the catalog. */\n catalogName?: string;\n /** Name of the catalog item. */\n catalogItemName?: string;\n /** Parameters object for the deploy action */\n parameters?: Record<string, unknown>;\n /** Set of supported scheduled tasks to help manage cost. */\n scheduledTasks?: Record<string, ScheduledTask>;\n /** Key value pairs that will be applied to resources deployed in this environment as tags. */\n tags?: Record<string, string>;\n}\n\n/** Scheduled task to auto-expire an environment. */\nexport interface ScheduledTask {\n /** Supported type this scheduled task represents. */\n type: \"AutoExpire\";\n /** Indicates whether or not this scheduled task is enabled. */\n enabled?: \"Enabled\" | \"Disabled\";\n /** Date/time by which the environment should expire */\n startTime: Date | string;\n}\n\n/** Action request */\nexport interface ActionRequest {\n /** The Catalog Item action id to execute */\n actionId: string;\n /** Parameters object for the Action */\n parameters?: Record<string, unknown>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=outputModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** Results of the project list operation. */\nexport interface ProjectListResultOutput {\n /** Current page of results. */\n value: Array<ProjectOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** Project details. */\nexport interface ProjectOutput {\n /** Name of the project */\n name?: string;\n /** Description of the project. */\n description?: string;\n}\n\n/** An error response from the service. */\nexport interface CloudErrorOutput {\n /** Error body */\n error: CloudErrorBodyOutput;\n}\n\n/** An error response from the service. */\nexport interface CloudErrorBodyOutput {\n /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */\n code: string;\n /** A message describing the error, intended to be suitable for display in a user interface. */\n message: string;\n /** The target of the particular error. For example, the name of the property in error. */\n target?: string;\n /** A list of additional details about the error. */\n details?: Array<CloudErrorBodyOutput>;\n}\n\n/** The Pool list result */\nexport interface PoolListResultOutput {\n /** Current page of results */\n value: Array<PoolOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** A pool of Dev Boxes. */\nexport interface PoolOutput {\n /** Pool name */\n name?: string;\n /** Azure region where Dev Boxes in the pool are located */\n location?: string;\n /** The operating system type of Dev Boxes in this pool */\n osType?: \"Windows\";\n /** Hardware settings for the Dev Boxes created in this pool */\n hardwareProfile?: HardwareProfileOutput;\n /** Storage settings for Dev Box created in this pool */\n storageProfile?: StorageProfileOutput;\n /** Image settings for Dev Boxes create in this pool */\n imageReference?: ImageReferenceOutput;\n /** Indicates whether owners of Dev Boxes in this pool are local administrators on the Dev Boxes. */\n localAdministrator?: \"Enabled\" | \"Disabled\";\n}\n\n/** Hardware specifications for the Dev Box. */\nexport interface HardwareProfileOutput {\n /** The name of the SKU */\n skuName?: string;\n /** The number of vCPUs available for the Dev Box. */\n vCPUs?: number;\n /** The amount of memory available for the Dev Box. */\n memoryGB?: number;\n}\n\n/** Storage settings for the Dev Box's disks */\nexport interface StorageProfileOutput {\n /** Settings for the operating system disk. */\n osDisk?: OSDiskOutput;\n}\n\n/** Settings for the operating system disk. */\nexport interface OSDiskOutput {\n /** The size of the OS Disk in gigabytes. */\n diskSizeGB?: number;\n}\n\n/** Specifies information about the image used */\nexport interface ImageReferenceOutput {\n /** The name of the image used. */\n name?: string;\n /** The version of the image. */\n version?: string;\n /** The operating system of the image. */\n operatingSystem?: string;\n /** The operating system build number of the image. */\n osBuildNumber?: string;\n /** The datetime that the backing image version was published. */\n publishedDate?: string;\n}\n\n/** The Schedule list result */\nexport interface ScheduleListResultOutput {\n /** Current page of results */\n value: Array<ScheduleOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** A Schedule to execute action. */\nexport interface ScheduleOutput {\n /** Display name for the Schedule */\n name?: string;\n /** Supported type this scheduled task represents. */\n type?: \"StopDevBox\";\n /** The frequency of this scheduled task. */\n frequency?: \"Daily\";\n /** The target time to trigger the action. The format is HH:MM. */\n time?: string;\n /** The IANA timezone id at which the schedule should execute. */\n timeZone?: string;\n}\n\n/** The Dev Box list result */\nexport interface DevBoxListResultOutput {\n /** The list of DevBox Dev Boxes */\n value: Array<DevBoxOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** A DevBox Dev Box */\nexport interface DevBoxOutput {\n /** Display name for the Dev Box */\n name?: string;\n /** Name of the project this Dev Box belongs to */\n projectName?: string;\n /** The name of the Dev Box pool this machine belongs to. */\n poolName: string;\n /** The current provisioning state of the Dev Box. */\n provisioningState?: string;\n /** The current action state of the Dev Box. This is state is based on previous action performed by user. */\n actionState?: string;\n /** The current power state of the Dev Box. */\n powerState?: \"Unknown\" | \"Deallocated\" | \"PoweredOff\" | \"Running\" | \"Hibernated\";\n /** A unique identifier for the Dev Box. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */\n uniqueId?: string;\n /** Provisioning or action error details. Populated only for error states. */\n errorDetails?: ProvisioningErrorOutput;\n /** Azure region where this Dev Box is located. This will be the same region as the Virtual Network it is attached to. */\n location?: string;\n /** The operating system type of this Dev Box. */\n osType?: \"Windows\";\n /** User identifier of the user this vm is assigned to. */\n user?: string;\n /** Information about the Dev Box's hardware resources */\n hardwareProfile?: HardwareProfileOutput;\n /** Storage settings for this Dev Box */\n storageProfile?: StorageProfileOutput;\n /** Information about the image used for this Dev Box */\n imageReference?: ImageReferenceOutput;\n /** Creation time of this Dev Box */\n createdTime?: string;\n /** Indicates whether the owner of the Dev Box is a local administrator. */\n localAdministrator?: \"Enabled\" | \"Disabled\";\n}\n\n/** Error details */\nexport interface ProvisioningErrorOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n}\n\n/** Provides RDP connection information */\nexport interface RemoteConnectionOutput {\n /** URL to open a browser based RDP session */\n webUrl?: string;\n /** Link to open a Remote Desktop session */\n rdpConnectionUrl?: string;\n}\n\n/** Results of the environment list operation. */\nexport interface EnvironmentListResultOutput {\n /** Current page of results. */\n value: Array<EnvironmentOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** Properties of an environment. */\nexport interface EnvironmentOutput extends EnvironmentUpdatePropertiesOutput {\n /** Environment name. */\n name?: string;\n /** Environment type. */\n environmentType: string;\n /** Identifier of the owner of this Environment. */\n owner?: string;\n /** The provisioning state of the environment. */\n provisioningState?: string;\n /** The identifier of the resource group containing the environment's resources. */\n resourceGroupId?: string;\n}\n\n/** Properties of an environment. These properties can be updated after the resource has been created. */\nexport interface EnvironmentUpdatePropertiesOutput {\n /** Description of the Environment. */\n description?: string;\n /** Name of the catalog. */\n catalogName?: string;\n /** Name of the catalog item. */\n catalogItemName?: string;\n /** Parameters object for the deploy action */\n parameters?: Record<string, unknown>;\n /** Set of supported scheduled tasks to help manage cost. */\n scheduledTasks?: Record<string, ScheduledTaskOutput>;\n /** Key value pairs that will be applied to resources deployed in this environment as tags. */\n tags?: Record<string, string>;\n}\n\n/** Scheduled task to auto-expire an environment. */\nexport interface ScheduledTaskOutput {\n /** Supported type this scheduled task represents. */\n type: \"AutoExpire\";\n /** Indicates whether or not this scheduled task is enabled. */\n enabled?: \"Enabled\" | \"Disabled\";\n /** Date/time by which the environment should expire */\n startTime: string;\n}\n\n/** Results of the artifact list operation. */\nexport interface ArtifactListResultOutput {\n /** Current page of results. */\n value: Array<ArtifactOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** Properties of an Artifact */\nexport interface ArtifactOutput {\n /** Artifact identifier */\n id?: string;\n /** Artifact name */\n name?: string;\n /** Whether artifact is a directory */\n isDirectory?: boolean;\n /** Uri where the file contents can be downloaded */\n downloadUri?: string;\n /** Size of file in bytes, if the artifact is a file */\n fileSize?: number;\n /** Time the artifact was created */\n createdTime?: string;\n /** Time the artifact was last modified */\n lastModifiedTime?: string;\n}\n\n/** Results of the catalog item list operation. */\nexport interface CatalogItemListResultOutput {\n /** Current page of results. */\n value: Array<CatalogItemOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** A catalog item. */\nexport interface CatalogItemOutput {\n /** Unique identifier of the catalog item. */\n id?: string;\n /** Name of the catalog item. */\n name?: string;\n /** Name of the catalog. */\n catalogName?: string;\n}\n\n/** Results of the catalog item list operation. */\nexport interface CatalogItemVersionListResultOutput {\n /** Current page of results. */\n value: Array<CatalogItemVersionOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** A catalog item version. */\nexport interface CatalogItemVersionOutput {\n /** Unique identifier of the catalog item. */\n catalogItemId?: string;\n /** Name of the catalog item. */\n catalogItemName?: string;\n /** Name of the catalog. */\n catalogName?: string;\n /** The version of the catalog item. */\n version?: string;\n /** A short summary of the catalog item. */\n summary?: string;\n /** A long description of the catalog item. */\n description?: string;\n /** Path to the catalog item entrypoint file. */\n templatePath?: string;\n /** JSON schema defining the parameters object passed to actions */\n parametersSchema?: string;\n /** Input parameters passed to actions */\n parameters?: Array<CatalogItemParameterOutput>;\n /** Custom actions for the catalog item. */\n actions?: Array<CatalogItemActionOutput>;\n /** The default container image to use to execute actions */\n runner?: string;\n /** Defines whether the specific catalog item version can be used. */\n status?: \"Enabled\" | \"Disabled\";\n /** Whether the version is eligible to be the latest version. */\n eligibleForLatestVersion?: boolean;\n}\n\n/** Properties of an Catalog Item parameter */\nexport interface CatalogItemParameterOutput {\n /** Unique ID of the parameter */\n id?: string;\n /** Display name of the parameter */\n name?: string;\n /** Description of the parameter */\n description?: string;\n /** Default value of the parameter */\n default?: Record<string, unknown>;\n /** A string of one of the basic JSON types (number, integer, null, array, object, boolean, string) */\n type?: \"array\" | \"boolean\" | \"integer\" | \"null\" | \"number\" | \"object\" | \"string\";\n /** Whether or not this parameter is read-only. If true, default should have a value. */\n readOnly?: boolean;\n /** Whether or not this parameter is required */\n required?: boolean;\n /** An array of allowed values */\n allowed?: Array<Record<string, unknown>>;\n}\n\n/** An action that can be taken on a catalog item. */\nexport interface CatalogItemActionOutput {\n /** Unique identifier of the action */\n id?: string;\n /** Display name of the action */\n name?: string;\n /** Description of the action */\n description?: string;\n /** JSON schema defining the parameters specific to the custom action */\n parametersSchema?: string;\n /** Input parameters passed to the action */\n parameters?: Array<CatalogItemParameterOutput>;\n /** The action type. */\n type?: \"Custom\" | \"Deploy\" | \"Delete\";\n /** Name of the custom action type */\n typeName?: string;\n /** The container image to use to execute the action */\n runner?: string;\n}\n\n/** Result of the environment type list operation. */\nexport interface EnvironmentTypeListResultOutput {\n /** Current page of results. */\n value: Array<EnvironmentTypeOutput>;\n /** URL to get the next set of results if there are any. */\n nextLink?: string;\n}\n\n/** Properties of an environment type. */\nexport interface EnvironmentTypeOutput {\n /** Name of the environment type */\n name?: string;\n /** Id of a subscription or management group that the environment type will be mapped to. The environment's resources will be deployed into this subscription or management group. */\n deploymentTargetId?: string;\n /** Defines whether this Environment Type can be used in this Project. */\n status?: \"Enabled\" | \"Disabled\";\n}\n"]}
@@ -0,0 +1,70 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { getPagedAsyncIterator } from "@azure/core-paging";
4
+ import { createRestError } from "@azure-rest/core-client";
5
+ /**
6
+ * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
+ * @param client - Client to use for sending the next page requests
8
+ * @param initialResponse - Initial response containing the nextLink and current page of elements
9
+ * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
10
+ * @returns - PagedAsyncIterableIterator to iterate the elements
11
+ */
12
+ export function paginate(client, initialResponse, options = {}) {
13
+ let firstRun = true;
14
+ const itemName = "value";
15
+ const nextLinkName = "nextLink";
16
+ const { customGetPage } = options;
17
+ const pagedResult = {
18
+ firstPageLink: "",
19
+ getPage: typeof customGetPage === "function"
20
+ ? customGetPage
21
+ : async (pageLink) => {
22
+ const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
23
+ firstRun = false;
24
+ checkPagingRequest(result);
25
+ const nextLink = getNextLink(result.body, nextLinkName);
26
+ const values = getElements(result.body, itemName);
27
+ return {
28
+ page: values,
29
+ nextPageLink: nextLink,
30
+ };
31
+ },
32
+ };
33
+ return getPagedAsyncIterator(pagedResult);
34
+ }
35
+ /**
36
+ * Gets for the value of nextLink in the body
37
+ */
38
+ function getNextLink(body, nextLinkName) {
39
+ if (!nextLinkName) {
40
+ return undefined;
41
+ }
42
+ const nextLink = body[nextLinkName];
43
+ if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
44
+ throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
45
+ }
46
+ return nextLink;
47
+ }
48
+ /**
49
+ * Gets the elements of the current request in the body.
50
+ */
51
+ function getElements(body, itemName) {
52
+ const value = body[itemName];
53
+ // value has to be an array according to the x-ms-pageable extension.
54
+ // The fact that this must be an array is used above to calculate the
55
+ // type of elements in the page in PaginateReturn
56
+ if (!Array.isArray(value)) {
57
+ throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
58
+ }
59
+ return value !== null && value !== void 0 ? value : [];
60
+ }
61
+ /**
62
+ * Checks if a request failed
63
+ */
64
+ function checkPagingRequest(response) {
65
+ const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
66
+ if (!Http2xxStatusCodes.includes(response.status)) {
67
+ throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
68
+ }
69
+ }
70
+ //# sourceMappingURL=paginateHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WAAW,CAAW,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC5D,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,YAAY,EAAE,QAAQ;iBACvB,CAAC;YACJ,CAAC;KACR,CAAC;IAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;KAClF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;KACH;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { DevBox, Environment, EnvironmentUpdateProperties, ActionRequest } from \"./models\";\n\nexport interface DevCenterListProjectsQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface DevCenterListProjectsQueryParam {\n queryParameters?: DevCenterListProjectsQueryParamProperties;\n}\n\nexport type DevCenterListProjectsParameters = DevCenterListProjectsQueryParam & RequestParameters;\nexport type DevCenterGetProjectParameters = RequestParameters;\n\nexport interface DevCenterListAllDevBoxesQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface DevCenterListAllDevBoxesQueryParam {\n queryParameters?: DevCenterListAllDevBoxesQueryParamProperties;\n}\n\nexport type DevCenterListAllDevBoxesParameters = DevCenterListAllDevBoxesQueryParam &\n RequestParameters;\n\nexport interface DevCenterListAllDevBoxesByUserQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface DevCenterListAllDevBoxesByUserQueryParam {\n queryParameters?: DevCenterListAllDevBoxesByUserQueryParamProperties;\n}\n\nexport type DevCenterListAllDevBoxesByUserParameters = DevCenterListAllDevBoxesByUserQueryParam &\n RequestParameters;\n\nexport interface DevBoxesListPoolsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n}\n\nexport interface DevBoxesListPoolsQueryParam {\n queryParameters?: DevBoxesListPoolsQueryParamProperties;\n}\n\nexport type DevBoxesListPoolsParameters = DevBoxesListPoolsQueryParam & RequestParameters;\nexport type DevBoxesGetPoolParameters = RequestParameters;\n\nexport interface DevBoxesListSchedulesByPoolQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n}\n\nexport interface DevBoxesListSchedulesByPoolQueryParam {\n queryParameters?: DevBoxesListSchedulesByPoolQueryParamProperties;\n}\n\nexport type DevBoxesListSchedulesByPoolParameters = DevBoxesListSchedulesByPoolQueryParam &\n RequestParameters;\nexport type DevBoxesGetScheduleByPoolParameters = RequestParameters;\n\nexport interface DevBoxesListDevBoxesByUserQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface DevBoxesListDevBoxesByUserQueryParam {\n queryParameters?: DevBoxesListDevBoxesByUserQueryParamProperties;\n}\n\nexport type DevBoxesListDevBoxesByUserParameters = DevBoxesListDevBoxesByUserQueryParam &\n RequestParameters;\nexport type DevBoxesGetDevBoxByUserParameters = RequestParameters;\n\nexport interface DevBoxesCreateDevBoxBodyParam {\n /** Represents a environment. */\n body: DevBox;\n}\n\nexport interface DevBoxesCreateDevBoxMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DevBoxesCreateDevBoxParameters = DevBoxesCreateDevBoxMediaTypesParam &\n DevBoxesCreateDevBoxBodyParam &\n RequestParameters;\nexport type DevBoxesDeleteDevBoxParameters = RequestParameters;\nexport type DevBoxesStartDevBoxParameters = RequestParameters;\nexport type DevBoxesStopDevBoxParameters = RequestParameters;\nexport type DevBoxesGetRemoteConnectionParameters = RequestParameters;\n\nexport interface EnvironmentsListEnvironmentsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface EnvironmentsListEnvironmentsQueryParam {\n queryParameters?: EnvironmentsListEnvironmentsQueryParamProperties;\n}\n\nexport type EnvironmentsListEnvironmentsParameters = EnvironmentsListEnvironmentsQueryParam &\n RequestParameters;\n\nexport interface EnvironmentsListEnvironmentsByUserQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface EnvironmentsListEnvironmentsByUserQueryParam {\n queryParameters?: EnvironmentsListEnvironmentsByUserQueryParamProperties;\n}\n\nexport type EnvironmentsListEnvironmentsByUserParameters = EnvironmentsListEnvironmentsByUserQueryParam &\n RequestParameters;\nexport type EnvironmentsGetEnvironmentByUserParameters = RequestParameters;\n\nexport interface EnvironmentsCreateOrUpdateEnvironmentBodyParam {\n /** Represents a environment. */\n body: Environment;\n}\n\nexport interface EnvironmentsCreateOrUpdateEnvironmentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type EnvironmentsCreateOrUpdateEnvironmentParameters = EnvironmentsCreateOrUpdateEnvironmentMediaTypesParam &\n EnvironmentsCreateOrUpdateEnvironmentBodyParam &\n RequestParameters;\n\nexport interface EnvironmentsUpdateEnvironmentBodyParam {\n /** Updatable environment properties. */\n body: EnvironmentUpdateProperties;\n}\n\nexport interface EnvironmentsUpdateEnvironmentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type EnvironmentsUpdateEnvironmentParameters = EnvironmentsUpdateEnvironmentMediaTypesParam &\n EnvironmentsUpdateEnvironmentBodyParam &\n RequestParameters;\nexport type EnvironmentsDeleteEnvironmentParameters = RequestParameters;\n\nexport interface EnvironmentsDeployEnvironmentActionBodyParam {\n /** Action properties overriding the environment's default values. */\n body: ActionRequest;\n}\n\nexport interface EnvironmentsDeployEnvironmentActionMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type EnvironmentsDeployEnvironmentActionParameters = EnvironmentsDeployEnvironmentActionMediaTypesParam &\n EnvironmentsDeployEnvironmentActionBodyParam &\n RequestParameters;\n\nexport interface EnvironmentsDeleteEnvironmentActionBodyParam {\n /** Action properties overriding the environment's default values. */\n body: ActionRequest;\n}\n\nexport interface EnvironmentsDeleteEnvironmentActionMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type EnvironmentsDeleteEnvironmentActionParameters = EnvironmentsDeleteEnvironmentActionMediaTypesParam &\n EnvironmentsDeleteEnvironmentActionBodyParam &\n RequestParameters;\n\nexport interface EnvironmentsCustomEnvironmentActionBodyParam {\n /** Action properties overriding the environment's default values. */\n body: ActionRequest;\n}\n\nexport interface EnvironmentsCustomEnvironmentActionMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type EnvironmentsCustomEnvironmentActionParameters = EnvironmentsCustomEnvironmentActionMediaTypesParam &\n EnvironmentsCustomEnvironmentActionBodyParam &\n RequestParameters;\nexport type EnvironmentsListArtifactsByEnvironmentParameters = RequestParameters;\nexport type EnvironmentsListArtifactsByEnvironmentAndPathParameters = RequestParameters;\n\nexport interface EnvironmentsListCatalogItemsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface EnvironmentsListCatalogItemsQueryParam {\n queryParameters?: EnvironmentsListCatalogItemsQueryParamProperties;\n}\n\nexport type EnvironmentsListCatalogItemsParameters = EnvironmentsListCatalogItemsQueryParam &\n RequestParameters;\nexport type EnvironmentsGetCatalogItemParameters = RequestParameters;\n\nexport interface EnvironmentsListCatalogItemVersionsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface EnvironmentsListCatalogItemVersionsQueryParam {\n queryParameters?: EnvironmentsListCatalogItemVersionsQueryParamProperties;\n}\n\nexport type EnvironmentsListCatalogItemVersionsParameters = EnvironmentsListCatalogItemVersionsQueryParam &\n RequestParameters;\nexport type EnvironmentsGetCatalogItemVersionParameters = RequestParameters;\n\nexport interface EnvironmentsListEnvironmentTypesQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface EnvironmentsListEnvironmentTypesQueryParam {\n queryParameters?: EnvironmentsListEnvironmentTypesQueryParamProperties;\n}\n\nexport type EnvironmentsListEnvironmentTypesParameters = EnvironmentsListEnvironmentTypesQueryParam &\n RequestParameters;\n"]}
@@ -0,0 +1,50 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { LroEngine, } from "@azure/core-lro";
4
+ /**
5
+ * Helper function that builds a Poller object to help polling a long running operation.
6
+ * @param client - Client to use for sending the request to get additional pages.
7
+ * @param initialResponse - The initial response.
8
+ * @param options - Options to set a resume state or custom polling interval.
9
+ * @returns - A poller object to poll for operation state updates and eventually get the final response.
10
+ */
11
+ export function getLongRunningPoller(client, initialResponse, options = {}) {
12
+ var _a;
13
+ const poller = {
14
+ requestMethod: initialResponse.request.method,
15
+ // Override this so we can poll on requests sent while recording
16
+ requestPath: (_a = initialResponse.request.headers.get("x-recording-upstream-base-uri")) !== null && _a !== void 0 ? _a : initialResponse.request.url,
17
+ sendInitialRequest: async () => {
18
+ // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
19
+ // we are not triggering the initial request here, just extracting the information from the
20
+ // response we were provided.
21
+ return getLroResponse(initialResponse);
22
+ },
23
+ sendPollRequest: async (path) => {
24
+ // This is the callback that is going to be called to poll the service
25
+ // to get the latest status. We use the client provided and the polling path
26
+ // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
27
+ // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
28
+ const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
29
+ const lroResponse = getLroResponse(response);
30
+ lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
31
+ return lroResponse;
32
+ },
33
+ };
34
+ return new LroEngine(poller, options);
35
+ }
36
+ /**
37
+ * Converts a Rest Client response to a response that the LRO engine knows about
38
+ * @param response - a rest client http response
39
+ * @returns - An LRO response that the LRO engine can work with
40
+ */
41
+ function getLroResponse(response) {
42
+ if (Number.isNaN(response.status)) {
43
+ throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
44
+ }
45
+ return {
46
+ flatResponse: response,
47
+ rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
48
+ };
49
+ }
50
+ //# sourceMappingURL=pollingHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,SAAS,GAKV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,eAAwB,EACxB,UAAkE,EAAE;;IAEpE,MAAM,MAAM,GAAkC;QAC5C,aAAa,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM;QAC7C,gEAAgE;QAChE,WAAW,EACT,MAAA,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,mCACpE,eAAe,CAAC,OAAO,CAAC,GAAG;QAC7B,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9B,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA0J;YAC1J,+GAA+G;YAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACvF,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;YACxD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;YACnF,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAA+B,QAAiB;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/F;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n // Override this so we can poll on requests sent while recording\n requestPath:\n initialResponse.request.headers.get(\"x-recording-upstream-base-uri\") ??\n initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n ProjectListResultOutput,\n CloudErrorOutput,\n ProjectOutput,\n DevBoxListResultOutput,\n PoolListResultOutput,\n PoolOutput,\n ScheduleListResultOutput,\n ScheduleOutput,\n DevBoxOutput,\n RemoteConnectionOutput,\n EnvironmentListResultOutput,\n EnvironmentOutput,\n ArtifactListResultOutput,\n CatalogItemListResultOutput,\n CatalogItemOutput,\n CatalogItemVersionListResultOutput,\n CatalogItemVersionOutput,\n EnvironmentTypeListResultOutput,\n} from \"./outputModels\";\n\n/** Lists all projects. */\nexport interface DevCenterListProjects200Response extends HttpResponse {\n status: \"200\";\n body: ProjectListResultOutput;\n}\n\n/** Lists all projects. */\nexport interface DevCenterListProjectsDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n}\n\n/** Gets a project. */\nexport interface DevCenterGetProject200Response extends HttpResponse {\n status: \"200\";\n body: ProjectOutput;\n}\n\n/** Gets a project. */\nexport interface DevCenterGetProjectDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n}\n\n/** Lists Dev Boxes that the caller has access to in the DevCenter. */\nexport interface DevCenterListAllDevBoxes200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxListResultOutput;\n}\n\nexport interface DevCenterListAllDevBoxesDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists Dev Boxes that the caller has access to in the DevCenter. */\nexport interface DevCenterListAllDevBoxesDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevCenterListAllDevBoxesDefaultHeaders;\n}\n\n/** Lists Dev Boxes in the Dev Center for a particular user. */\nexport interface DevCenterListAllDevBoxesByUser200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxListResultOutput;\n}\n\nexport interface DevCenterListAllDevBoxesByUserDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists Dev Boxes in the Dev Center for a particular user. */\nexport interface DevCenterListAllDevBoxesByUserDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevCenterListAllDevBoxesByUserDefaultHeaders;\n}\n\n/** Lists available pools */\nexport interface DevBoxesListPools200Response extends HttpResponse {\n status: \"200\";\n body: PoolListResultOutput;\n}\n\nexport interface DevBoxesListPoolsDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists available pools */\nexport interface DevBoxesListPoolsDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesListPoolsDefaultHeaders;\n}\n\n/** Gets a pool */\nexport interface DevBoxesGetPool200Response extends HttpResponse {\n status: \"200\";\n body: PoolOutput;\n}\n\nexport interface DevBoxesGetPoolDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Gets a pool */\nexport interface DevBoxesGetPoolDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesGetPoolDefaultHeaders;\n}\n\n/** Lists available schedules for a pool. */\nexport interface DevBoxesListSchedulesByPool200Response extends HttpResponse {\n status: \"200\";\n body: ScheduleListResultOutput;\n}\n\nexport interface DevBoxesListSchedulesByPoolDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists available schedules for a pool. */\nexport interface DevBoxesListSchedulesByPoolDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesListSchedulesByPoolDefaultHeaders;\n}\n\n/** Gets a schedule. */\nexport interface DevBoxesGetScheduleByPool200Response extends HttpResponse {\n status: \"200\";\n body: ScheduleOutput;\n}\n\nexport interface DevBoxesGetScheduleByPoolDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Gets a schedule. */\nexport interface DevBoxesGetScheduleByPoolDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesGetScheduleByPoolDefaultHeaders;\n}\n\n/** Lists Dev Boxes in the project for a particular user. */\nexport interface DevBoxesListDevBoxesByUser200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxListResultOutput;\n}\n\nexport interface DevBoxesListDevBoxesByUserDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists Dev Boxes in the project for a particular user. */\nexport interface DevBoxesListDevBoxesByUserDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesListDevBoxesByUserDefaultHeaders;\n}\n\n/** Gets a Dev Box */\nexport interface DevBoxesGetDevBoxByUser200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface DevBoxesGetDevBoxByUserDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Gets a Dev Box */\nexport interface DevBoxesGetDevBoxByUserDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesGetDevBoxByUserDefaultHeaders;\n}\n\n/** Creates or updates a Dev Box. */\nexport interface DevBoxesCreateDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\n/** Creates or updates a Dev Box. */\nexport interface DevBoxesCreateDevBox201Response extends HttpResponse {\n status: \"201\";\n body: DevBoxOutput;\n}\n\nexport interface DevBoxesCreateDevBoxDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Creates or updates a Dev Box. */\nexport interface DevBoxesCreateDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesCreateDevBoxDefaultHeaders;\n}\n\n/** Deletes a Dev Box. */\nexport interface DevBoxesDeleteDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface DevBoxesDeleteDevBox202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Deletes a Dev Box. */\nexport interface DevBoxesDeleteDevBox202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & DevBoxesDeleteDevBox202Headers;\n}\n\n/** Deletes a Dev Box. */\nexport interface DevBoxesDeleteDevBox204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface DevBoxesDeleteDevBoxDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Deletes a Dev Box. */\nexport interface DevBoxesDeleteDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesDeleteDevBoxDefaultHeaders;\n}\n\n/** Starts a Dev Box */\nexport interface DevBoxesStartDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface DevBoxesStartDevBox202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Starts a Dev Box */\nexport interface DevBoxesStartDevBox202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & DevBoxesStartDevBox202Headers;\n}\n\nexport interface DevBoxesStartDevBoxDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Starts a Dev Box */\nexport interface DevBoxesStartDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesStartDevBoxDefaultHeaders;\n}\n\n/** Stops a Dev Box */\nexport interface DevBoxesStopDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface DevBoxesStopDevBox202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Stops a Dev Box */\nexport interface DevBoxesStopDevBox202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & DevBoxesStopDevBox202Headers;\n}\n\nexport interface DevBoxesStopDevBoxDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Stops a Dev Box */\nexport interface DevBoxesStopDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesStopDevBoxDefaultHeaders;\n}\n\n/** Gets RDP Connection info */\nexport interface DevBoxesGetRemoteConnection200Response extends HttpResponse {\n status: \"200\";\n body: RemoteConnectionOutput;\n}\n\nexport interface DevBoxesGetRemoteConnectionDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Gets RDP Connection info */\nexport interface DevBoxesGetRemoteConnectionDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & DevBoxesGetRemoteConnectionDefaultHeaders;\n}\n\n/** Lists the environments for a project. */\nexport interface EnvironmentsListEnvironments200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentListResultOutput;\n}\n\nexport interface EnvironmentsListEnvironmentsDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists the environments for a project. */\nexport interface EnvironmentsListEnvironmentsDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListEnvironmentsDefaultHeaders;\n}\n\n/** Lists the environments for a project and user. */\nexport interface EnvironmentsListEnvironmentsByUser200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentListResultOutput;\n}\n\nexport interface EnvironmentsListEnvironmentsByUserDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists the environments for a project and user. */\nexport interface EnvironmentsListEnvironmentsByUserDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListEnvironmentsByUserDefaultHeaders;\n}\n\n/** Gets an environment */\nexport interface EnvironmentsGetEnvironmentByUser200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentOutput;\n}\n\nexport interface EnvironmentsGetEnvironmentByUserDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Gets an environment */\nexport interface EnvironmentsGetEnvironmentByUserDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsGetEnvironmentByUserDefaultHeaders;\n}\n\n/** Creates or updates an environment. */\nexport interface EnvironmentsCreateOrUpdateEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentOutput;\n}\n\nexport interface EnvironmentsCreateOrUpdateEnvironment201Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Creates or updates an environment. */\nexport interface EnvironmentsCreateOrUpdateEnvironment201Response extends HttpResponse {\n status: \"201\";\n body: EnvironmentOutput;\n headers: RawHttpHeaders & EnvironmentsCreateOrUpdateEnvironment201Headers;\n}\n\nexport interface EnvironmentsCreateOrUpdateEnvironmentDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Creates or updates an environment. */\nexport interface EnvironmentsCreateOrUpdateEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsCreateOrUpdateEnvironmentDefaultHeaders;\n}\n\n/** Partially updates an environment */\nexport interface EnvironmentsUpdateEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentOutput;\n}\n\nexport interface EnvironmentsUpdateEnvironmentDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Partially updates an environment */\nexport interface EnvironmentsUpdateEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsUpdateEnvironmentDefaultHeaders;\n}\n\n/** Deletes an environment and all it's associated resources */\nexport interface EnvironmentsDeleteEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\nexport interface EnvironmentsDeleteEnvironment202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Deletes an environment and all it's associated resources */\nexport interface EnvironmentsDeleteEnvironment202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & EnvironmentsDeleteEnvironment202Headers;\n}\n\n/** Deletes an environment and all it's associated resources */\nexport interface EnvironmentsDeleteEnvironment204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface EnvironmentsDeleteEnvironmentDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Deletes an environment and all it's associated resources */\nexport interface EnvironmentsDeleteEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsDeleteEnvironmentDefaultHeaders;\n}\n\n/** Executes a deploy action */\nexport interface EnvironmentsDeployEnvironmentAction200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\nexport interface EnvironmentsDeployEnvironmentAction202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Executes a deploy action */\nexport interface EnvironmentsDeployEnvironmentAction202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & EnvironmentsDeployEnvironmentAction202Headers;\n}\n\nexport interface EnvironmentsDeployEnvironmentActionDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Executes a deploy action */\nexport interface EnvironmentsDeployEnvironmentActionDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsDeployEnvironmentActionDefaultHeaders;\n}\n\n/** Executes a delete action */\nexport interface EnvironmentsDeleteEnvironmentAction200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\nexport interface EnvironmentsDeleteEnvironmentAction202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Executes a delete action */\nexport interface EnvironmentsDeleteEnvironmentAction202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & EnvironmentsDeleteEnvironmentAction202Headers;\n}\n\nexport interface EnvironmentsDeleteEnvironmentActionDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Executes a delete action */\nexport interface EnvironmentsDeleteEnvironmentActionDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsDeleteEnvironmentActionDefaultHeaders;\n}\n\n/** Executes a custom action */\nexport interface EnvironmentsCustomEnvironmentAction200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\nexport interface EnvironmentsCustomEnvironmentAction202Headers {\n /** URL to query for status of the operation. */\n \"operation-location\"?: string;\n}\n\n/** Executes a custom action */\nexport interface EnvironmentsCustomEnvironmentAction202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n headers: RawHttpHeaders & EnvironmentsCustomEnvironmentAction202Headers;\n}\n\nexport interface EnvironmentsCustomEnvironmentActionDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Executes a custom action */\nexport interface EnvironmentsCustomEnvironmentActionDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsCustomEnvironmentActionDefaultHeaders;\n}\n\n/** Lists the artifacts for an environment */\nexport interface EnvironmentsListArtifactsByEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: ArtifactListResultOutput;\n}\n\nexport interface EnvironmentsListArtifactsByEnvironmentDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists the artifacts for an environment */\nexport interface EnvironmentsListArtifactsByEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListArtifactsByEnvironmentDefaultHeaders;\n}\n\n/** Lists the artifacts for an environment at a specified path, or returns the file at the path. */\nexport interface EnvironmentsListArtifactsByEnvironmentAndPath200Response extends HttpResponse {\n status: \"200\";\n body: ArtifactListResultOutput;\n}\n\nexport interface EnvironmentsListArtifactsByEnvironmentAndPathDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists the artifacts for an environment at a specified path, or returns the file at the path. */\nexport interface EnvironmentsListArtifactsByEnvironmentAndPathDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListArtifactsByEnvironmentAndPathDefaultHeaders;\n}\n\n/** Lists latest version of all catalog items available for a project. */\nexport interface EnvironmentsListCatalogItems200Response extends HttpResponse {\n status: \"200\";\n body: CatalogItemListResultOutput;\n}\n\nexport interface EnvironmentsListCatalogItemsDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists latest version of all catalog items available for a project. */\nexport interface EnvironmentsListCatalogItemsDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListCatalogItemsDefaultHeaders;\n}\n\n/** Get a catalog item from a project. */\nexport interface EnvironmentsGetCatalogItem200Response extends HttpResponse {\n status: \"200\";\n body: CatalogItemOutput;\n}\n\nexport interface EnvironmentsGetCatalogItemDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get a catalog item from a project. */\nexport interface EnvironmentsGetCatalogItemDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsGetCatalogItemDefaultHeaders;\n}\n\n/** List all versions of a catalog item from a project. */\nexport interface EnvironmentsListCatalogItemVersions200Response extends HttpResponse {\n status: \"200\";\n body: CatalogItemVersionListResultOutput;\n}\n\nexport interface EnvironmentsListCatalogItemVersionsDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** List all versions of a catalog item from a project. */\nexport interface EnvironmentsListCatalogItemVersionsDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListCatalogItemVersionsDefaultHeaders;\n}\n\n/** Get a specific catalog item version from a project. */\nexport interface EnvironmentsGetCatalogItemVersion200Response extends HttpResponse {\n status: \"200\";\n body: CatalogItemVersionOutput;\n}\n\nexport interface EnvironmentsGetCatalogItemVersionDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get a specific catalog item version from a project. */\nexport interface EnvironmentsGetCatalogItemVersionDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsGetCatalogItemVersionDefaultHeaders;\n}\n\n/** Lists all environment types configured for a project. */\nexport interface EnvironmentsListEnvironmentTypes200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentTypeListResultOutput;\n}\n\nexport interface EnvironmentsListEnvironmentTypesDefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Lists all environment types configured for a project. */\nexport interface EnvironmentsListEnvironmentTypesDefaultResponse extends HttpResponse {\n status: string;\n body: CloudErrorOutput;\n headers: RawHttpHeaders & EnvironmentsListEnvironmentTypesDefaultHeaders;\n}\n"]}