@azure/arm-devspaces 2.0.1-alpha.20221101.1 → 2.1.0

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +10 -11
  2. package/README.md +11 -0
  3. package/dist/index.js +206 -51
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.d.ts +2 -0
  8. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.d.ts.map +1 -0
  9. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.js +34 -0
  10. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.js.map +1 -0
  11. package/dist-esm/samples-dev/controllersCreateSample.d.ts +2 -0
  12. package/dist-esm/samples-dev/controllersCreateSample.d.ts.map +1 -0
  13. package/dist-esm/samples-dev/controllersCreateSample.js +38 -0
  14. package/dist-esm/samples-dev/controllersCreateSample.js.map +1 -0
  15. package/dist-esm/samples-dev/controllersDeleteSample.d.ts +2 -0
  16. package/dist-esm/samples-dev/controllersDeleteSample.d.ts.map +1 -0
  17. package/dist-esm/samples-dev/controllersDeleteSample.js +31 -0
  18. package/dist-esm/samples-dev/controllersDeleteSample.js.map +1 -0
  19. package/dist-esm/samples-dev/controllersGetSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/controllersGetSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/controllersGetSample.js +31 -0
  22. package/dist-esm/samples-dev/controllersGetSample.js.map +1 -0
  23. package/dist-esm/samples-dev/controllersListByResourceGroupSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/controllersListByResourceGroupSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/controllersListByResourceGroupSample.js +44 -0
  26. package/dist-esm/samples-dev/controllersListByResourceGroupSample.js.map +1 -0
  27. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.d.ts +2 -0
  28. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.d.ts.map +1 -0
  29. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.js +34 -0
  30. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.js.map +1 -0
  31. package/dist-esm/samples-dev/controllersListSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/controllersListSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/controllersListSample.js +43 -0
  34. package/dist-esm/samples-dev/controllersListSample.js.map +1 -0
  35. package/dist-esm/samples-dev/controllersUpdateSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/controllersUpdateSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/controllersUpdateSample.js +35 -0
  38. package/dist-esm/samples-dev/controllersUpdateSample.js.map +1 -0
  39. package/dist-esm/src/devSpacesManagementClient.d.ts +2 -0
  40. package/dist-esm/src/devSpacesManagementClient.d.ts.map +1 -1
  41. package/dist-esm/src/devSpacesManagementClient.js +54 -5
  42. package/dist-esm/src/devSpacesManagementClient.js.map +1 -1
  43. package/dist-esm/src/index.d.ts +1 -0
  44. package/dist-esm/src/index.d.ts.map +1 -1
  45. package/dist-esm/src/index.js +1 -0
  46. package/dist-esm/src/index.js.map +1 -1
  47. package/dist-esm/src/models/index.d.ts +15 -6
  48. package/dist-esm/src/models/index.d.ts.map +1 -1
  49. package/dist-esm/src/models/index.js +9 -0
  50. package/dist-esm/src/models/index.js.map +1 -1
  51. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  52. package/dist-esm/src/models/mappers.js +1 -0
  53. package/dist-esm/src/models/mappers.js.map +1 -1
  54. package/dist-esm/src/operations/controllers.d.ts.map +1 -1
  55. package/dist-esm/src/operations/controllers.js +43 -16
  56. package/dist-esm/src/operations/controllers.js.map +1 -1
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  58. package/dist-esm/src/operations/operations.js +19 -7
  59. package/dist-esm/src/operations/operations.js.map +1 -1
  60. package/dist-esm/src/pagingHelper.d.ts +13 -0
  61. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  62. package/dist-esm/src/pagingHelper.js +32 -0
  63. package/dist-esm/src/pagingHelper.js.map +1 -0
  64. package/dist-esm/test/sampleTest.js +11 -13
  65. package/dist-esm/test/sampleTest.js.map +1 -1
  66. package/package.json +37 -17
  67. package/review/arm-devspaces.api.md +14 -20
  68. package/rollup.config.js +6 -72
  69. package/src/devSpacesManagementClient.ts +70 -5
  70. package/src/index.ts +1 -0
  71. package/src/models/index.ts +16 -6
  72. package/src/models/mappers.ts +1 -0
  73. package/src/operations/controllers.ts +52 -19
  74. package/src/operations/operations.ts +21 -8
  75. package/src/pagingHelper.ts +39 -0
  76. package/tsconfig.json +19 -5
  77. package/types/arm-devspaces.d.ts +26 -6
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "mgmt",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for DevSpacesManagementClient.",
6
- "version": "2.0.1-alpha.20221101.1",
6
+ "version": "2.1.0",
7
7
  "engines": {
8
8
  "node": ">=14.0.0"
9
9
  },
@@ -11,9 +11,9 @@
11
11
  "@azure/core-lro": "^2.2.0",
12
12
  "@azure/abort-controller": "^1.0.0",
13
13
  "@azure/core-paging": "^1.2.0",
14
- "@azure/core-client": "^1.0.0",
14
+ "@azure/core-client": "^1.6.1",
15
15
  "@azure/core-auth": "^1.3.0",
16
- "@azure/core-rest-pipeline": "^1.1.0",
16
+ "@azure/core-rest-pipeline": "^1.8.0",
17
17
  "tslib": "^2.2.0"
18
18
  },
19
19
  "keywords": [
@@ -29,20 +29,25 @@
29
29
  "types": "./types/arm-devspaces.d.ts",
30
30
  "devDependencies": {
31
31
  "@microsoft/api-extractor": "^7.31.1",
32
- "@rollup/plugin-commonjs": "11.0.2",
33
- "@rollup/plugin-json": "^4.0.0",
34
- "@rollup/plugin-multi-entry": "^3.0.0",
35
- "@rollup/plugin-node-resolve": "^8.0.0",
32
+ "@rollup/plugin-commonjs": "^21.0.1",
33
+ "@rollup/plugin-json": "^4.1.0",
34
+ "@rollup/plugin-multi-entry": "^4.1.0",
35
+ "@rollup/plugin-node-resolve": "^13.1.3",
36
36
  "mkdirp": "^1.0.4",
37
- "rollup": "^1.16.3",
38
- "rollup-plugin-sourcemaps": "^0.4.2",
39
- "typescript": "~4.2.0",
37
+ "rollup": "^2.66.1",
38
+ "rollup-plugin-sourcemaps": "^0.6.3",
39
+ "typescript": "~4.8.0",
40
40
  "uglify-js": "^3.4.9",
41
41
  "rimraf": "^3.0.0",
42
42
  "@azure/identity": "^2.0.1",
43
- "@azure-tools/test-recorder": "^1.0.0",
43
+ "@azure-tools/test-recorder": "^2.0.0",
44
+ "@azure-tools/test-credential": "^1.0.0",
44
45
  "mocha": "^7.1.1",
45
- "cross-env": "^7.0.2"
46
+ "@types/chai": "^4.2.8",
47
+ "chai": "^4.2.0",
48
+ "cross-env": "^7.0.2",
49
+ "@types/node": "^14.0.0",
50
+ "@azure/dev-tool": "^1.0.0"
46
51
  },
47
52
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devspaces/arm-devspaces",
48
53
  "repository": {
@@ -93,10 +98,25 @@
93
98
  "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
94
99
  "unit-test:browser": "echo skipped",
95
100
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
96
- "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
97
- "integration-test:browser": "echo skipped",
98
- "docs": "echo skipped"
101
+ "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
102
+ "integration-test:browser": "echo skipped"
99
103
  },
100
104
  "sideEffects": false,
101
- "autoPublish": true
102
- }
105
+ "//metadata": {
106
+ "constantPaths": [
107
+ {
108
+ "path": "src/devSpacesManagementClient.ts",
109
+ "prefix": "packageDetails"
110
+ }
111
+ ]
112
+ },
113
+ "autoPublish": true,
114
+ "//sampleConfiguration": {
115
+ "productName": "",
116
+ "productSlugs": [
117
+ "azure"
118
+ ],
119
+ "disableDocsMs": true,
120
+ "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-devspaces?view=azure-node-preview"
121
+ }
122
+ }
@@ -29,15 +29,15 @@ export interface ContainerHostMappingsGetContainerHostMappingOptionalParams exte
29
29
  export type ContainerHostMappingsGetContainerHostMappingResponse = ContainerHostMapping;
30
30
 
31
31
  // @public (undocumented)
32
- export type Controller = TrackedResource & {
33
- sku: Sku;
34
- readonly provisioningState?: ProvisioningState;
35
- readonly hostSuffix?: string;
32
+ export interface Controller extends TrackedResource {
36
33
  readonly dataPlaneFqdn?: string;
34
+ readonly hostSuffix?: string;
35
+ readonly provisioningState?: ProvisioningState;
36
+ sku: Sku;
37
37
  readonly targetContainerHostApiServerFqdn?: string;
38
- targetContainerHostResourceId: string;
39
38
  targetContainerHostCredentialsBase64: string;
40
- };
39
+ targetContainerHostResourceId: string;
40
+ }
41
41
 
42
42
  // @public (undocumented)
43
43
  export interface ControllerConnectionDetails {
@@ -176,41 +176,35 @@ export interface ErrorDetails {
176
176
  readonly target?: string;
177
177
  }
178
178
 
179
+ // @public
180
+ export function getContinuationToken(page: unknown): string | undefined;
181
+
179
182
  // @public
180
183
  export enum KnownProvisioningState {
181
- // (undocumented)
182
184
  Canceled = "Canceled",
183
- // (undocumented)
184
185
  Creating = "Creating",
185
- // (undocumented)
186
186
  Deleted = "Deleted",
187
- // (undocumented)
188
187
  Deleting = "Deleting",
189
- // (undocumented)
190
188
  Failed = "Failed",
191
- // (undocumented)
192
189
  Succeeded = "Succeeded",
193
- // (undocumented)
194
190
  Updating = "Updating"
195
191
  }
196
192
 
197
193
  // @public
198
194
  export enum KnownSkuName {
199
- // (undocumented)
200
195
  S1 = "S1"
201
196
  }
202
197
 
203
198
  // @public
204
199
  export enum KnownSkuTier {
205
- // (undocumented)
206
200
  Standard = "Standard"
207
201
  }
208
202
 
209
203
  // @public
210
- export type KubernetesConnectionDetails = OrchestratorSpecificConnectionDetails & {
204
+ export interface KubernetesConnectionDetails extends OrchestratorSpecificConnectionDetails {
211
205
  instanceType: "Kubernetes";
212
206
  kubeConfig?: string;
213
- };
207
+ }
214
208
 
215
209
  // @public
216
210
  export interface ListConnectionDetailsParameters {
@@ -288,12 +282,12 @@ export type SkuName = string;
288
282
  export type SkuTier = string;
289
283
 
290
284
  // @public
291
- export type TrackedResource = Resource & {
285
+ export interface TrackedResource extends Resource {
286
+ location?: string;
292
287
  tags?: {
293
288
  [propertyName: string]: string;
294
289
  };
295
- location?: string;
296
- };
290
+ }
297
291
 
298
292
  // (No @packageDocumentation comment for this package)
299
293
 
package/rollup.config.js CHANGED
@@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
14
14
 
15
15
  import nodeBuiltins from "builtin-modules";
16
16
 
17
- /**
18
- * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
- *
20
- * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
- * __exportStar downleveled helper function to declare its exports which confuses
22
- * rollup's automatic discovery mechanism.
23
- *
24
- * @returns an object reference that can be `...`'d into your cjs() configuration.
25
- */
26
- export function openTelemetryCommonJs() {
27
- const namedExports = {};
28
-
29
- for (const key of [
30
- "@opentelemetry/api",
31
- "@azure/core-tracing/node_modules/@opentelemetry/api"
32
- ]) {
33
- namedExports[key] = [
34
- "SpanKind",
35
- "TraceFlags",
36
- "getSpan",
37
- "setSpan",
38
- "SpanStatusCode",
39
- "getSpanContext",
40
- "setSpanContext"
41
- ];
42
- }
43
-
44
- const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
-
46
- for (const version of releasedOpenTelemetryVersions) {
47
- namedExports[
48
- // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
- `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
- ] = [
51
- "SpanKind",
52
- "TraceFlags",
53
- "getSpan",
54
- "setSpan",
55
- "StatusCode",
56
- "CanonicalCode",
57
- "getSpanContext",
58
- "setSpanContext"
59
- ];
60
- }
61
-
62
- return namedExports;
63
- }
64
-
65
17
  // #region Warning Handler
66
18
 
67
19
  /**
68
- * A function that can determine whether a rollupwarning should be ignored. If
20
+ * A function that can determine whether a rollup warning should be ignored. If
69
21
  * the function returns `true`, then the warning will not be displayed.
70
22
  */
71
23
 
72
- function ignoreNiseSinonEvalWarnings(warning) {
24
+ function ignoreNiseSinonEval(warning) {
73
25
  return (
74
26
  warning.code === "EVAL" &&
75
27
  warning.id &&
@@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
78
30
  );
79
31
  }
80
32
 
81
- function ignoreChaiCircularDependencyWarnings(warning) {
33
+ function ignoreChaiCircularDependency(warning) {
82
34
  return (
83
35
  warning.code === "CIRCULAR_DEPENDENCY" &&
84
36
  warning.importer && warning.importer.includes("node_modules/chai") === true
85
37
  );
86
38
  }
87
39
 
88
- const warningInhibitors = [
89
- ignoreChaiCircularDependencyWarnings,
90
- ignoreNiseSinonEvalWarnings
91
- ];
40
+ const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
92
41
 
93
42
  /**
94
43
  * Construct a warning handler for the shared rollup configuration
@@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
122
71
  nodeResolve({
123
72
  mainFields: ["module", "browser"]
124
73
  }),
125
- cjs({
126
- namedExports: {
127
- // Chai's strange internal architecture makes it impossible to statically
128
- // analyze its exports.
129
- chai: [
130
- "version",
131
- "use",
132
- "util",
133
- "config",
134
- "expect",
135
- "should",
136
- "assert"
137
- ],
138
- ...openTelemetryCommonJs()
139
- }
140
- }),
74
+ cjs(),
141
75
  json(),
142
76
  sourcemaps()
143
77
  //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
@@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
173
107
  ],
174
108
  output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
109
  preserveSymlinks: false,
176
- plugins: [sourcemaps(), nodeResolve(), cjs()]
110
+ plugins: [sourcemaps(), nodeResolve()]
177
111
  };
178
112
 
179
113
  const config = [baseConfig];
@@ -7,6 +7,12 @@
7
7
  */
8
8
 
9
9
  import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
10
16
  import * as coreAuth from "@azure/core-auth";
11
17
  import {
12
18
  ContainerHostMappingsImpl,
@@ -52,24 +58,54 @@ export class DevSpacesManagementClient extends coreClient.ServiceClient {
52
58
  credential: credentials
53
59
  };
54
60
 
55
- const packageDetails = `azsdk-js-arm-devspaces/2.0.0`;
61
+ const packageDetails = `azsdk-js-arm-devspaces/2.1.0`;
56
62
  const userAgentPrefix =
57
63
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
58
64
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
59
65
  : `${packageDetails}`;
60
66
 
61
- if (!options.credentialScopes) {
62
- options.credentialScopes = ["https://management.azure.com/.default"];
63
- }
64
67
  const optionsWithDefaults = {
65
68
  ...defaults,
66
69
  ...options,
67
70
  userAgentOptions: {
68
71
  userAgentPrefix
69
72
  },
70
- baseUri: options.endpoint || "https://management.azure.com"
73
+ endpoint:
74
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
71
75
  };
72
76
  super(optionsWithDefaults);
77
+
78
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
79
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
80
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
81
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
82
+ (pipelinePolicy) =>
83
+ pipelinePolicy.name ===
84
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
85
+ );
86
+ }
87
+ if (
88
+ !options ||
89
+ !options.pipeline ||
90
+ options.pipeline.getOrderedPolicies().length == 0 ||
91
+ !bearerTokenAuthenticationPolicyFound
92
+ ) {
93
+ this.pipeline.removePolicy({
94
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
95
+ });
96
+ this.pipeline.addPolicy(
97
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
98
+ credential: credentials,
99
+ scopes:
100
+ optionsWithDefaults.credentialScopes ??
101
+ `${optionsWithDefaults.endpoint}/.default`,
102
+ challengeCallbacks: {
103
+ authorizeRequestOnChallenge:
104
+ coreClient.authorizeRequestOnClaimChallenge
105
+ }
106
+ })
107
+ );
108
+ }
73
109
  // Parameter assignments
74
110
  this.subscriptionId = subscriptionId;
75
111
 
@@ -79,6 +115,35 @@ export class DevSpacesManagementClient extends coreClient.ServiceClient {
79
115
  this.containerHostMappings = new ContainerHostMappingsImpl(this);
80
116
  this.operations = new OperationsImpl(this);
81
117
  this.controllers = new ControllersImpl(this);
118
+ this.addCustomApiVersionPolicy(options.apiVersion);
119
+ }
120
+
121
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
122
+ private addCustomApiVersionPolicy(apiVersion?: string) {
123
+ if (!apiVersion) {
124
+ return;
125
+ }
126
+ const apiVersionPolicy = {
127
+ name: "CustomApiVersionPolicy",
128
+ async sendRequest(
129
+ request: PipelineRequest,
130
+ next: SendRequest
131
+ ): Promise<PipelineResponse> {
132
+ const param = request.url.split("?");
133
+ if (param.length > 1) {
134
+ const newParams = param[1].split("&").map((item) => {
135
+ if (item.indexOf("api-version") > -1) {
136
+ return "api-version=" + apiVersion;
137
+ } else {
138
+ return item;
139
+ }
140
+ });
141
+ request.url = param[0] + "?" + newParams.join("&");
142
+ }
143
+ return next(request);
144
+ }
145
+ };
146
+ this.pipeline.addPolicy(apiVersionPolicy);
82
147
  }
83
148
 
84
149
  containerHostMappings: ContainerHostMappings;
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  /// <reference lib="esnext.asynciterable" />
10
+ export { getContinuationToken } from "./pagingHelper";
10
11
  export * from "./models";
11
12
  export { DevSpacesManagementClient } from "./devSpacesManagementClient";
12
13
  export * from "./operationsInterfaces";
@@ -142,22 +142,23 @@ export interface OrchestratorSpecificConnectionDetails {
142
142
  }
143
143
 
144
144
  /** The resource model definition for a ARM tracked top level resource. */
145
- export type TrackedResource = Resource & {
145
+ export interface TrackedResource extends Resource {
146
146
  /** Tags for the Azure resource. */
147
147
  tags?: { [propertyName: string]: string };
148
148
  /** Region where the Azure resource is located. */
149
149
  location?: string;
150
- };
150
+ }
151
151
 
152
152
  /** Contains information used to connect to a Kubernetes cluster */
153
- export type KubernetesConnectionDetails = OrchestratorSpecificConnectionDetails & {
153
+ export interface KubernetesConnectionDetails
154
+ extends OrchestratorSpecificConnectionDetails {
154
155
  /** Polymorphic discriminator, which specifies the different types this object can be */
155
156
  instanceType: "Kubernetes";
156
157
  /** Gets the kubeconfig for the cluster. */
157
158
  kubeConfig?: string;
158
- };
159
+ }
159
160
 
160
- export type Controller = TrackedResource & {
161
+ export interface Controller extends TrackedResource {
161
162
  /** Model representing SKU for Azure Dev Spaces Controller. */
162
163
  sku: Sku;
163
164
  /**
@@ -184,16 +185,23 @@ export type Controller = TrackedResource & {
184
185
  targetContainerHostResourceId: string;
185
186
  /** Credentials of the target container host (base64). */
186
187
  targetContainerHostCredentialsBase64: string;
187
- };
188
+ }
188
189
 
189
190
  /** Known values of {@link ProvisioningState} that the service accepts. */
190
191
  export enum KnownProvisioningState {
192
+ /** Succeeded */
191
193
  Succeeded = "Succeeded",
194
+ /** Failed */
192
195
  Failed = "Failed",
196
+ /** Canceled */
193
197
  Canceled = "Canceled",
198
+ /** Updating */
194
199
  Updating = "Updating",
200
+ /** Creating */
195
201
  Creating = "Creating",
202
+ /** Deleting */
196
203
  Deleting = "Deleting",
204
+ /** Deleted */
197
205
  Deleted = "Deleted"
198
206
  }
199
207
 
@@ -214,6 +222,7 @@ export type ProvisioningState = string;
214
222
 
215
223
  /** Known values of {@link SkuName} that the service accepts. */
216
224
  export enum KnownSkuName {
225
+ /** S1 */
217
226
  S1 = "S1"
218
227
  }
219
228
 
@@ -228,6 +237,7 @@ export type SkuName = string;
228
237
 
229
238
  /** Known values of {@link SkuTier} that the service accepts. */
230
239
  export enum KnownSkuTier {
240
+ /** Standard */
231
241
  Standard = "Standard"
232
242
  }
233
243
 
@@ -326,6 +326,7 @@ export const OrchestratorSpecificConnectionDetails: coreClient.CompositeMapper =
326
326
  modelProperties: {
327
327
  instanceType: {
328
328
  serializedName: "instanceType",
329
+ required: true,
329
330
  readOnly: true,
330
331
  type: {
331
332
  name: "String"
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Controllers } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,8 +19,10 @@ import {
18
19
  Controller,
19
20
  ControllersListByResourceGroupNextOptionalParams,
20
21
  ControllersListByResourceGroupOptionalParams,
22
+ ControllersListByResourceGroupResponse,
21
23
  ControllersListNextOptionalParams,
22
24
  ControllersListOptionalParams,
25
+ ControllersListResponse,
23
26
  ControllersGetOptionalParams,
24
27
  ControllersGetResponse,
25
28
  ControllersCreateOptionalParams,
@@ -28,8 +31,6 @@ import {
28
31
  ControllerUpdateParameters,
29
32
  ControllersUpdateOptionalParams,
30
33
  ControllersUpdateResponse,
31
- ControllersListByResourceGroupResponse,
32
- ControllersListResponse,
33
34
  ListConnectionDetailsParameters,
34
35
  ControllersListConnectionDetailsOptionalParams,
35
36
  ControllersListConnectionDetailsResponse,
@@ -68,19 +69,33 @@ export class ControllersImpl implements Controllers {
68
69
  [Symbol.asyncIterator]() {
69
70
  return this;
70
71
  },
71
- byPage: () => {
72
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
72
+ byPage: (settings?: PageSettings) => {
73
+ if (settings?.maxPageSize) {
74
+ throw new Error("maxPageSize is not supported by this operation.");
75
+ }
76
+ return this.listByResourceGroupPagingPage(
77
+ resourceGroupName,
78
+ options,
79
+ settings
80
+ );
73
81
  }
74
82
  };
75
83
  }
76
84
 
77
85
  private async *listByResourceGroupPagingPage(
78
86
  resourceGroupName: string,
79
- options?: ControllersListByResourceGroupOptionalParams
87
+ options?: ControllersListByResourceGroupOptionalParams,
88
+ settings?: PageSettings
80
89
  ): AsyncIterableIterator<Controller[]> {
81
- let result = await this._listByResourceGroup(resourceGroupName, options);
82
- yield result.value || [];
83
- let continuationToken = result.nextLink;
90
+ let result: ControllersListByResourceGroupResponse;
91
+ let continuationToken = settings?.continuationToken;
92
+ if (!continuationToken) {
93
+ result = await this._listByResourceGroup(resourceGroupName, options);
94
+ let page = result.value || [];
95
+ continuationToken = result.nextLink;
96
+ setContinuationToken(page, continuationToken);
97
+ yield page;
98
+ }
84
99
  while (continuationToken) {
85
100
  result = await this._listByResourceGroupNext(
86
101
  resourceGroupName,
@@ -88,7 +103,9 @@ export class ControllersImpl implements Controllers {
88
103
  options
89
104
  );
90
105
  continuationToken = result.nextLink;
91
- yield result.value || [];
106
+ let page = result.value || [];
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
92
109
  }
93
110
  }
94
111
 
@@ -119,22 +136,34 @@ export class ControllersImpl implements Controllers {
119
136
  [Symbol.asyncIterator]() {
120
137
  return this;
121
138
  },
122
- byPage: () => {
123
- return this.listPagingPage(options);
139
+ byPage: (settings?: PageSettings) => {
140
+ if (settings?.maxPageSize) {
141
+ throw new Error("maxPageSize is not supported by this operation.");
142
+ }
143
+ return this.listPagingPage(options, settings);
124
144
  }
125
145
  };
126
146
  }
127
147
 
128
148
  private async *listPagingPage(
129
- options?: ControllersListOptionalParams
149
+ options?: ControllersListOptionalParams,
150
+ settings?: PageSettings
130
151
  ): AsyncIterableIterator<Controller[]> {
131
- let result = await this._list(options);
132
- yield result.value || [];
133
- let continuationToken = result.nextLink;
152
+ let result: ControllersListResponse;
153
+ let continuationToken = settings?.continuationToken;
154
+ if (!continuationToken) {
155
+ result = await this._list(options);
156
+ let page = result.value || [];
157
+ continuationToken = result.nextLink;
158
+ setContinuationToken(page, continuationToken);
159
+ yield page;
160
+ }
134
161
  while (continuationToken) {
135
162
  result = await this._listNext(continuationToken, options);
136
163
  continuationToken = result.nextLink;
137
- yield result.value || [];
164
+ let page = result.value || [];
165
+ setContinuationToken(page, continuationToken);
166
+ yield page;
138
167
  }
139
168
  }
140
169
 
@@ -225,10 +254,12 @@ export class ControllersImpl implements Controllers {
225
254
  { resourceGroupName, name, controller, options },
226
255
  createOperationSpec
227
256
  );
228
- return new LroEngine(lro, {
257
+ const poller = new LroEngine(lro, {
229
258
  resumeFrom: options?.resumeFrom,
230
259
  intervalInMs: options?.updateIntervalInMs
231
260
  });
261
+ await poller.poll();
262
+ return poller;
232
263
  }
233
264
 
234
265
  /**
@@ -308,10 +339,12 @@ export class ControllersImpl implements Controllers {
308
339
  { resourceGroupName, name, options },
309
340
  deleteOperationSpec
310
341
  );
311
- return new LroEngine(lro, {
342
+ const poller = new LroEngine(lro, {
312
343
  resumeFrom: options?.resumeFrom,
313
344
  intervalInMs: options?.updateIntervalInMs
314
345
  });
346
+ await poller.poll();
347
+ return poller;
315
348
  }
316
349
 
317
350
  /**
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -49,22 +50,34 @@ export class OperationsImpl implements Operations {
49
50
  [Symbol.asyncIterator]() {
50
51
  return this;
51
52
  },
52
- byPage: () => {
53
- return this.listPagingPage(options);
53
+ byPage: (settings?: PageSettings) => {
54
+ if (settings?.maxPageSize) {
55
+ throw new Error("maxPageSize is not supported by this operation.");
56
+ }
57
+ return this.listPagingPage(options, settings);
54
58
  }
55
59
  };
56
60
  }
57
61
 
58
62
  private async *listPagingPage(
59
- options?: OperationsListOptionalParams
63
+ options?: OperationsListOptionalParams,
64
+ settings?: PageSettings
60
65
  ): AsyncIterableIterator<ResourceProviderOperationDefinition[]> {
61
- let result = await this._list(options);
62
- yield result.value || [];
63
- let continuationToken = result.nextLink;
66
+ let result: OperationsListResponse;
67
+ let continuationToken = settings?.continuationToken;
68
+ if (!continuationToken) {
69
+ result = await this._list(options);
70
+ let page = result.value || [];
71
+ continuationToken = result.nextLink;
72
+ setContinuationToken(page, continuationToken);
73
+ yield page;
74
+ }
64
75
  while (continuationToken) {
65
76
  result = await this._listNext(continuationToken, options);
66
77
  continuationToken = result.nextLink;
67
- yield result.value || [];
78
+ let page = result.value || [];
79
+ setContinuationToken(page, continuationToken);
80
+ yield page;
68
81
  }
69
82
  }
70
83