@azure/arm-deviceupdate 1.0.1-alpha.20230127.1 → 1.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 (104) hide show
  1. package/CHANGELOG.md +6 -9
  2. package/LICENSE +1 -1
  3. package/dist/index.js +133 -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/accountsCreateSample.js +11 -3
  8. package/dist-esm/samples-dev/accountsCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/accountsDeleteSample.js +11 -3
  10. package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/accountsGetSample.js +11 -3
  12. package/dist-esm/samples-dev/accountsGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/accountsHeadSample.js +11 -3
  14. package/dist-esm/samples-dev/accountsHeadSample.js.map +1 -1
  15. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +11 -3
  16. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -1
  17. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +10 -2
  18. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -1
  19. package/dist-esm/samples-dev/accountsUpdateSample.js +11 -3
  20. package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/checkNameAvailabilitySample.js +13 -4
  22. package/dist-esm/samples-dev/checkNameAvailabilitySample.js.map +1 -1
  23. package/dist-esm/samples-dev/instancesCreateSample.js +11 -3
  24. package/dist-esm/samples-dev/instancesCreateSample.js.map +1 -1
  25. package/dist-esm/samples-dev/instancesDeleteSample.js +11 -3
  26. package/dist-esm/samples-dev/instancesDeleteSample.js.map +1 -1
  27. package/dist-esm/samples-dev/instancesGetSample.js +11 -3
  28. package/dist-esm/samples-dev/instancesGetSample.js.map +1 -1
  29. package/dist-esm/samples-dev/instancesHeadSample.js +11 -3
  30. package/dist-esm/samples-dev/instancesHeadSample.js.map +1 -1
  31. package/dist-esm/samples-dev/instancesListByAccountSample.js +11 -3
  32. package/dist-esm/samples-dev/instancesListByAccountSample.js.map +1 -1
  33. package/dist-esm/samples-dev/instancesUpdateSample.js +11 -3
  34. package/dist-esm/samples-dev/instancesUpdateSample.js.map +1 -1
  35. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  36. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  37. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.js +11 -3
  38. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.js.map +1 -1
  39. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.js +11 -3
  40. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.js.map +1 -1
  41. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.js +11 -3
  42. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.js.map +1 -1
  43. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.js +11 -3
  44. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.js.map +1 -1
  45. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.js +11 -3
  46. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.js.map +1 -1
  47. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.js +11 -3
  48. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.js.map +1 -1
  49. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js +11 -3
  50. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js.map +1 -1
  51. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +11 -3
  52. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js.map +1 -1
  53. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +11 -3
  54. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js.map +1 -1
  55. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.js +11 -3
  56. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.js.map +1 -1
  57. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js +11 -3
  58. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js.map +1 -1
  59. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.js +11 -3
  60. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.js.map +1 -1
  61. package/dist-esm/src/deviceUpdate.d.ts.map +1 -1
  62. package/dist-esm/src/deviceUpdate.js +4 -7
  63. package/dist-esm/src/deviceUpdate.js.map +1 -1
  64. package/dist-esm/src/index.d.ts +1 -0
  65. package/dist-esm/src/index.d.ts.map +1 -1
  66. package/dist-esm/src/index.js +1 -0
  67. package/dist-esm/src/index.js.map +1 -1
  68. package/dist-esm/src/models/index.d.ts.map +1 -1
  69. package/dist-esm/src/operations/accounts.d.ts.map +1 -1
  70. package/dist-esm/src/operations/accounts.js +37 -16
  71. package/dist-esm/src/operations/accounts.js.map +1 -1
  72. package/dist-esm/src/operations/instances.d.ts.map +1 -1
  73. package/dist-esm/src/operations/instances.js +19 -8
  74. package/dist-esm/src/operations/instances.js.map +1 -1
  75. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  76. package/dist-esm/src/operations/operations.js +19 -8
  77. package/dist-esm/src/operations/operations.js.map +1 -1
  78. package/dist-esm/src/operations/privateEndpointConnectionProxies.d.ts.map +1 -1
  79. package/dist-esm/src/operations/privateEndpointConnectionProxies.js +8 -4
  80. package/dist-esm/src/operations/privateEndpointConnectionProxies.js.map +1 -1
  81. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  82. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  83. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  84. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  85. package/dist-esm/src/operations/privateLinkResources.js +8 -4
  86. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  87. package/dist-esm/src/pagingHelper.d.ts +13 -0
  88. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  89. package/dist-esm/src/pagingHelper.js +32 -0
  90. package/dist-esm/src/pagingHelper.js.map +1 -0
  91. package/package.json +7 -5
  92. package/review/arm-deviceupdate.api.md +3 -0
  93. package/src/deviceUpdate.ts +5 -6
  94. package/src/index.ts +1 -0
  95. package/src/models/index.ts +25 -25
  96. package/src/operations/accounts.ts +45 -18
  97. package/src/operations/instances.ts +26 -13
  98. package/src/operations/operations.ts +21 -9
  99. package/src/operations/privateEndpointConnectionProxies.ts +11 -9
  100. package/src/operations/privateEndpointConnections.ts +11 -9
  101. package/src/operations/privateLinkResources.ts +11 -9
  102. package/src/pagingHelper.ts +39 -0
  103. package/types/arm-deviceupdate.d.ts +9 -0
  104. package/types/tsdoc-metadata.json +1 -1
@@ -34,14 +34,18 @@ export class PrivateLinkResourcesImpl {
34
34
  [Symbol.asyncIterator]() {
35
35
  return this;
36
36
  },
37
- byPage: () => {
38
- return this.listByAccountPagingPage(resourceGroupName, accountName, options);
37
+ byPage: (settings) => {
38
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
39
+ throw new Error("maxPageSize is not supported by this operation.");
40
+ }
41
+ return this.listByAccountPagingPage(resourceGroupName, accountName, options, settings);
39
42
  }
40
43
  };
41
44
  }
42
- listByAccountPagingPage(resourceGroupName, accountName, options) {
45
+ listByAccountPagingPage(resourceGroupName, accountName, options, _settings) {
43
46
  return __asyncGenerator(this, arguments, function* listByAccountPagingPage_1() {
44
- let result = yield __await(this._listByAccount(resourceGroupName, accountName, options));
47
+ let result;
48
+ result = yield __await(this._listByAccount(resourceGroupName, accountName, options));
45
49
  yield yield __await(result.value || []);
46
50
  });
47
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"privateLinkResources.js","sourceRoot":"","sources":["../../../src/operations/privateLinkResources.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"privateLinkResources.js","sourceRoot":"","sources":["../../../src/operations/privateLinkResources.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ export interface PageInfo {
2
+ continuationToken?: string;
3
+ }
4
+ /**
5
+ * Given the last `.value` produced by the `byPage` iterator,
6
+ * returns a continuation token that can be used to begin paging from
7
+ * that point later.
8
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
9
+ * @returns The continuation token that can be passed into byPage() during future calls.
10
+ */
11
+ export declare function getContinuationToken(page: unknown): string | undefined;
12
+ export declare function setContinuationToken(page: unknown, continuationToken: string | undefined): void;
13
+ //# sourceMappingURL=pagingHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagingHelper.d.ts","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACpC,IAAI,CAON"}
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ const pageMap = new WeakMap();
9
+ /**
10
+ * Given the last `.value` produced by the `byPage` iterator,
11
+ * returns a continuation token that can be used to begin paging from
12
+ * that point later.
13
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
14
+ * @returns The continuation token that can be passed into byPage() during future calls.
15
+ */
16
+ export function getContinuationToken(page) {
17
+ var _a;
18
+ if (typeof page !== "object" || page === null) {
19
+ return undefined;
20
+ }
21
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
22
+ }
23
+ export function setContinuationToken(page, continuationToken) {
24
+ var _a;
25
+ if (typeof page !== "object" || page === null || !continuationToken) {
26
+ return;
27
+ }
28
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
29
+ pageInfo.continuationToken = continuationToken;
30
+ pageMap.set(page, pageInfo);
31
+ }
32
+ //# sourceMappingURL=pagingHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;QAC7C,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAa,EACb,iBAAqC;;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE;QACnE,OAAO;KACR;IACD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC"}
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 DeviceUpdate.",
6
- "version": "1.0.1-alpha.20230127.1",
6
+ "version": "1.1.0",
7
7
  "engines": {
8
8
  "node": ">=14.0.0"
9
9
  },
@@ -11,7 +11,7 @@
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.5.0",
14
+ "@azure/core-client": "^1.6.1",
15
15
  "@azure/core-auth": "^1.3.0",
16
16
  "@azure/core-rest-pipeline": "^1.8.0",
17
17
  "tslib": "^2.2.0"
@@ -36,9 +36,10 @@
36
36
  "mkdirp": "^1.0.4",
37
37
  "rollup": "^2.66.1",
38
38
  "rollup-plugin-sourcemaps": "^0.6.3",
39
- "typescript": "~4.6.0",
39
+ "typescript": "~4.8.0",
40
40
  "uglify-js": "^3.4.9",
41
41
  "rimraf": "^3.0.0",
42
+ "dotenv": "^8.2.0",
42
43
  "@azure/identity": "^2.0.1",
43
44
  "@azure-tools/test-recorder": "^2.0.0",
44
45
  "@azure-tools/test-credential": "^1.0.0",
@@ -46,9 +47,9 @@
46
47
  "@types/chai": "^4.2.8",
47
48
  "chai": "^4.2.0",
48
49
  "cross-env": "^7.0.2",
49
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb"
50
+ "@types/node": "^14.0.0",
51
+ "@azure/dev-tool": "^1.0.0"
50
52
  },
51
- "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/arm-deviceupdate",
52
53
  "repository": {
53
54
  "type": "git",
54
55
  "url": "https://github.com/Azure/azure-sdk-for-js.git"
@@ -110,6 +111,7 @@
110
111
  ]
111
112
  },
112
113
  "autoPublish": true,
114
+ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/arm-deviceupdate",
113
115
  "//sampleConfiguration": {
114
116
  "productName": "",
115
117
  "productSlugs": [
@@ -214,6 +214,9 @@ export interface ErrorResponse {
214
214
  error?: ErrorDetail;
215
215
  }
216
216
 
217
+ // @public
218
+ export function getContinuationToken(page: unknown): string | undefined;
219
+
217
220
  // @public
218
221
  export interface GroupConnectivityInformation {
219
222
  customerVisibleFqdns?: string[];
@@ -71,22 +71,19 @@ export class DeviceUpdate extends coreClient.ServiceClient {
71
71
  credential: credentials
72
72
  };
73
73
 
74
- const packageDetails = `azsdk-js-arm-deviceupdate/1.0.1`;
74
+ const packageDetails = `azsdk-js-arm-deviceupdate/1.1.0`;
75
75
  const userAgentPrefix =
76
76
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
77
77
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
78
78
  : `${packageDetails}`;
79
79
 
80
- if (!options.credentialScopes) {
81
- options.credentialScopes = ["https://management.azure.com/.default"];
82
- }
83
80
  const optionsWithDefaults = {
84
81
  ...defaults,
85
82
  ...options,
86
83
  userAgentOptions: {
87
84
  userAgentPrefix
88
85
  },
89
- baseUri:
86
+ endpoint:
90
87
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
91
88
  };
92
89
  super(optionsWithDefaults);
@@ -112,7 +109,9 @@ export class DeviceUpdate extends coreClient.ServiceClient {
112
109
  this.pipeline.addPolicy(
113
110
  coreRestPipeline.bearerTokenAuthenticationPolicy({
114
111
  credential: credentials,
115
- scopes: `${optionsWithDefaults.credentialScopes}`,
112
+ scopes:
113
+ optionsWithDefaults.credentialScopes ??
114
+ `${optionsWithDefaults.endpoint}/.default`,
116
115
  challengeCallbacks: {
117
116
  authorizeRequestOnChallenge:
118
117
  coreClient.authorizeRequestOnClaimChallenge
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 { DeviceUpdate } from "./deviceUpdate";
12
13
  export * from "./operationsInterfaces";
@@ -470,7 +470,7 @@ export interface TrackedResource extends Resource {
470
470
  }
471
471
 
472
472
  /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
473
- export interface ProxyResource extends Resource {}
473
+ export interface ProxyResource extends Resource { }
474
474
 
475
475
  /** Request payload used to update and existing Accounts. */
476
476
  export interface AccountUpdate extends TagUpdate {
@@ -493,7 +493,7 @@ export interface GroupInformationProperties
493
493
  /** Private endpoint connection proxy details. */
494
494
  export interface PrivateEndpointConnectionProxy
495
495
  extends ProxyResource,
496
- PrivateEndpointConnectionProxyProperties {
496
+ PrivateEndpointConnectionProxyProperties {
497
497
  /**
498
498
  * The provisioning state of the private endpoint connection proxy resource.
499
499
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -503,7 +503,7 @@ export interface PrivateEndpointConnectionProxy
503
503
 
504
504
  /** Remote private endpoint connection details. */
505
505
  export interface PrivateLinkServiceProxyRemotePrivateEndpointConnection
506
- extends RemotePrivateEndpointConnection {}
506
+ extends RemotePrivateEndpointConnection { }
507
507
 
508
508
  /** Device Update account details. */
509
509
  export interface Account extends TrackedResource {
@@ -866,35 +866,35 @@ export type ActionType = string;
866
866
 
867
867
  /** Optional parameters. */
868
868
  export interface CheckNameAvailabilityOptionalParams
869
- extends coreClient.OperationOptions {}
869
+ extends coreClient.OperationOptions { }
870
870
 
871
871
  /** Contains response data for the checkNameAvailability operation. */
872
872
  export type CheckNameAvailabilityOperationResponse = CheckNameAvailabilityResponse;
873
873
 
874
874
  /** Optional parameters. */
875
875
  export interface AccountsListBySubscriptionOptionalParams
876
- extends coreClient.OperationOptions {}
876
+ extends coreClient.OperationOptions { }
877
877
 
878
878
  /** Contains response data for the listBySubscription operation. */
879
879
  export type AccountsListBySubscriptionResponse = AccountList;
880
880
 
881
881
  /** Optional parameters. */
882
882
  export interface AccountsListByResourceGroupOptionalParams
883
- extends coreClient.OperationOptions {}
883
+ extends coreClient.OperationOptions { }
884
884
 
885
885
  /** Contains response data for the listByResourceGroup operation. */
886
886
  export type AccountsListByResourceGroupResponse = AccountList;
887
887
 
888
888
  /** Optional parameters. */
889
889
  export interface AccountsGetOptionalParams
890
- extends coreClient.OperationOptions {}
890
+ extends coreClient.OperationOptions { }
891
891
 
892
892
  /** Contains response data for the get operation. */
893
893
  export type AccountsGetResponse = Account;
894
894
 
895
895
  /** Optional parameters. */
896
896
  export interface AccountsHeadOptionalParams
897
- extends coreClient.OperationOptions {}
897
+ extends coreClient.OperationOptions { }
898
898
 
899
899
  /** Contains response data for the head operation. */
900
900
  export type AccountsHeadResponse = {
@@ -936,35 +936,35 @@ export type AccountsUpdateResponse = Account;
936
936
 
937
937
  /** Optional parameters. */
938
938
  export interface AccountsListBySubscriptionNextOptionalParams
939
- extends coreClient.OperationOptions {}
939
+ extends coreClient.OperationOptions { }
940
940
 
941
941
  /** Contains response data for the listBySubscriptionNext operation. */
942
942
  export type AccountsListBySubscriptionNextResponse = AccountList;
943
943
 
944
944
  /** Optional parameters. */
945
945
  export interface AccountsListByResourceGroupNextOptionalParams
946
- extends coreClient.OperationOptions {}
946
+ extends coreClient.OperationOptions { }
947
947
 
948
948
  /** Contains response data for the listByResourceGroupNext operation. */
949
949
  export type AccountsListByResourceGroupNextResponse = AccountList;
950
950
 
951
951
  /** Optional parameters. */
952
952
  export interface InstancesListByAccountOptionalParams
953
- extends coreClient.OperationOptions {}
953
+ extends coreClient.OperationOptions { }
954
954
 
955
955
  /** Contains response data for the listByAccount operation. */
956
956
  export type InstancesListByAccountResponse = InstanceList;
957
957
 
958
958
  /** Optional parameters. */
959
959
  export interface InstancesGetOptionalParams
960
- extends coreClient.OperationOptions {}
960
+ extends coreClient.OperationOptions { }
961
961
 
962
962
  /** Contains response data for the get operation. */
963
963
  export type InstancesGetResponse = Instance;
964
964
 
965
965
  /** Optional parameters. */
966
966
  export interface InstancesHeadOptionalParams
967
- extends coreClient.OperationOptions {}
967
+ extends coreClient.OperationOptions { }
968
968
 
969
969
  /** Contains response data for the head operation. */
970
970
  export type InstancesHeadResponse = {
@@ -994,28 +994,28 @@ export interface InstancesDeleteOptionalParams
994
994
 
995
995
  /** Optional parameters. */
996
996
  export interface InstancesUpdateOptionalParams
997
- extends coreClient.OperationOptions {}
997
+ extends coreClient.OperationOptions { }
998
998
 
999
999
  /** Contains response data for the update operation. */
1000
1000
  export type InstancesUpdateResponse = Instance;
1001
1001
 
1002
1002
  /** Optional parameters. */
1003
1003
  export interface InstancesListByAccountNextOptionalParams
1004
- extends coreClient.OperationOptions {}
1004
+ extends coreClient.OperationOptions { }
1005
1005
 
1006
1006
  /** Contains response data for the listByAccountNext operation. */
1007
1007
  export type InstancesListByAccountNextResponse = InstanceList;
1008
1008
 
1009
1009
  /** Optional parameters. */
1010
1010
  export interface PrivateEndpointConnectionsListByAccountOptionalParams
1011
- extends coreClient.OperationOptions {}
1011
+ extends coreClient.OperationOptions { }
1012
1012
 
1013
1013
  /** Contains response data for the listByAccount operation. */
1014
1014
  export type PrivateEndpointConnectionsListByAccountResponse = PrivateEndpointConnectionListResult;
1015
1015
 
1016
1016
  /** Optional parameters. */
1017
1017
  export interface PrivateEndpointConnectionsGetOptionalParams
1018
- extends coreClient.OperationOptions {}
1018
+ extends coreClient.OperationOptions { }
1019
1019
 
1020
1020
  /** Contains response data for the get operation. */
1021
1021
  export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection;
@@ -1043,36 +1043,36 @@ export interface PrivateEndpointConnectionsDeleteOptionalParams
1043
1043
 
1044
1044
  /** Optional parameters. */
1045
1045
  export interface PrivateLinkResourcesListByAccountOptionalParams
1046
- extends coreClient.OperationOptions {}
1046
+ extends coreClient.OperationOptions { }
1047
1047
 
1048
1048
  /** Contains response data for the listByAccount operation. */
1049
1049
  export type PrivateLinkResourcesListByAccountResponse = PrivateLinkResourceListResult;
1050
1050
 
1051
1051
  /** Optional parameters. */
1052
1052
  export interface PrivateLinkResourcesGetOptionalParams
1053
- extends coreClient.OperationOptions {}
1053
+ extends coreClient.OperationOptions { }
1054
1054
 
1055
1055
  /** Contains response data for the get operation. */
1056
1056
  export type PrivateLinkResourcesGetResponse = GroupInformation;
1057
1057
 
1058
1058
  /** Optional parameters. */
1059
1059
  export interface PrivateEndpointConnectionProxiesListByAccountOptionalParams
1060
- extends coreClient.OperationOptions {}
1060
+ extends coreClient.OperationOptions { }
1061
1061
 
1062
1062
  /** Contains response data for the listByAccount operation. */
1063
1063
  export type PrivateEndpointConnectionProxiesListByAccountResponse = PrivateEndpointConnectionProxyListResult;
1064
1064
 
1065
1065
  /** Optional parameters. */
1066
1066
  export interface PrivateEndpointConnectionProxiesValidateOptionalParams
1067
- extends coreClient.OperationOptions {}
1067
+ extends coreClient.OperationOptions { }
1068
1068
 
1069
1069
  /** Optional parameters. */
1070
1070
  export interface PrivateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesOptionalParams
1071
- extends coreClient.OperationOptions {}
1071
+ extends coreClient.OperationOptions { }
1072
1072
 
1073
1073
  /** Optional parameters. */
1074
1074
  export interface PrivateEndpointConnectionProxiesGetOptionalParams
1075
- extends coreClient.OperationOptions {}
1075
+ extends coreClient.OperationOptions { }
1076
1076
 
1077
1077
  /** Contains response data for the get operation. */
1078
1078
  export type PrivateEndpointConnectionProxiesGetResponse = PrivateEndpointConnectionProxy;
@@ -1100,14 +1100,14 @@ export interface PrivateEndpointConnectionProxiesDeleteOptionalParams
1100
1100
 
1101
1101
  /** Optional parameters. */
1102
1102
  export interface OperationsListOptionalParams
1103
- extends coreClient.OperationOptions {}
1103
+ extends coreClient.OperationOptions { }
1104
1104
 
1105
1105
  /** Contains response data for the list operation. */
1106
1106
  export type OperationsListResponse = OperationListResult;
1107
1107
 
1108
1108
  /** Optional parameters. */
1109
1109
  export interface OperationsListNextOptionalParams
1110
- extends coreClient.OperationOptions {}
1110
+ extends coreClient.OperationOptions { }
1111
1111
 
1112
1112
  /** Contains response data for the listNext operation. */
1113
1113
  export type OperationsListNextResponse = OperationListResult;
@@ -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 { Accounts } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,9 +19,9 @@ import {
18
19
  Account,
19
20
  AccountsListBySubscriptionNextOptionalParams,
20
21
  AccountsListBySubscriptionOptionalParams,
22
+ AccountsListBySubscriptionResponse,
21
23
  AccountsListByResourceGroupNextOptionalParams,
22
24
  AccountsListByResourceGroupOptionalParams,
23
- AccountsListBySubscriptionResponse,
24
25
  AccountsListByResourceGroupResponse,
25
26
  AccountsGetOptionalParams,
26
27
  AccountsGetResponse,
@@ -64,22 +65,34 @@ export class AccountsImpl implements Accounts {
64
65
  [Symbol.asyncIterator]() {
65
66
  return this;
66
67
  },
67
- byPage: () => {
68
- return this.listBySubscriptionPagingPage(options);
68
+ byPage: (settings?: PageSettings) => {
69
+ if (settings?.maxPageSize) {
70
+ throw new Error("maxPageSize is not supported by this operation.");
71
+ }
72
+ return this.listBySubscriptionPagingPage(options, settings);
69
73
  }
70
74
  };
71
75
  }
72
76
 
73
77
  private async *listBySubscriptionPagingPage(
74
- options?: AccountsListBySubscriptionOptionalParams
78
+ options?: AccountsListBySubscriptionOptionalParams,
79
+ settings?: PageSettings
75
80
  ): AsyncIterableIterator<Account[]> {
76
- let result = await this._listBySubscription(options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
81
+ let result: AccountsListBySubscriptionResponse;
82
+ let continuationToken = settings?.continuationToken;
83
+ if (!continuationToken) {
84
+ result = await this._listBySubscription(options);
85
+ let page = result.value || [];
86
+ continuationToken = result.nextLink;
87
+ setContinuationToken(page, continuationToken);
88
+ yield page;
89
+ }
79
90
  while (continuationToken) {
80
91
  result = await this._listBySubscriptionNext(continuationToken, options);
81
92
  continuationToken = result.nextLink;
82
- yield result.value || [];
93
+ let page = result.value || [];
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
83
96
  }
84
97
  }
85
98
 
@@ -108,19 +121,33 @@ export class AccountsImpl implements Accounts {
108
121
  [Symbol.asyncIterator]() {
109
122
  return this;
110
123
  },
111
- byPage: () => {
112
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
124
+ byPage: (settings?: PageSettings) => {
125
+ if (settings?.maxPageSize) {
126
+ throw new Error("maxPageSize is not supported by this operation.");
127
+ }
128
+ return this.listByResourceGroupPagingPage(
129
+ resourceGroupName,
130
+ options,
131
+ settings
132
+ );
113
133
  }
114
134
  };
115
135
  }
116
136
 
117
137
  private async *listByResourceGroupPagingPage(
118
138
  resourceGroupName: string,
119
- options?: AccountsListByResourceGroupOptionalParams
139
+ options?: AccountsListByResourceGroupOptionalParams,
140
+ settings?: PageSettings
120
141
  ): AsyncIterableIterator<Account[]> {
121
- let result = await this._listByResourceGroup(resourceGroupName, options);
122
- yield result.value || [];
123
- let continuationToken = result.nextLink;
142
+ let result: AccountsListByResourceGroupResponse;
143
+ let continuationToken = settings?.continuationToken;
144
+ if (!continuationToken) {
145
+ result = await this._listByResourceGroup(resourceGroupName, options);
146
+ let page = result.value || [];
147
+ continuationToken = result.nextLink;
148
+ setContinuationToken(page, continuationToken);
149
+ yield page;
150
+ }
124
151
  while (continuationToken) {
125
152
  result = await this._listByResourceGroupNext(
126
153
  resourceGroupName,
@@ -128,7 +155,9 @@ export class AccountsImpl implements Accounts {
128
155
  options
129
156
  );
130
157
  continuationToken = result.nextLink;
131
- yield result.value || [];
158
+ let page = result.value || [];
159
+ setContinuationToken(page, continuationToken);
160
+ yield page;
132
161
  }
133
162
  }
134
163
 
@@ -690,7 +719,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
690
719
  bodyMapper: Mappers.ErrorResponse
691
720
  }
692
721
  },
693
- queryParameters: [Parameters.apiVersion],
694
722
  urlParameters: [
695
723
  Parameters.$host,
696
724
  Parameters.subscriptionId,
@@ -710,7 +738,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
710
738
  bodyMapper: Mappers.ErrorResponse
711
739
  }
712
740
  },
713
- queryParameters: [Parameters.apiVersion],
714
741
  urlParameters: [
715
742
  Parameters.$host,
716
743
  Parameters.subscriptionId,
@@ -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 { Instances } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -68,11 +69,15 @@ export class InstancesImpl implements Instances {
68
69
  [Symbol.asyncIterator]() {
69
70
  return this;
70
71
  },
71
- byPage: () => {
72
+ byPage: (settings?: PageSettings) => {
73
+ if (settings?.maxPageSize) {
74
+ throw new Error("maxPageSize is not supported by this operation.");
75
+ }
72
76
  return this.listByAccountPagingPage(
73
77
  resourceGroupName,
74
78
  accountName,
75
- options
79
+ options,
80
+ settings
76
81
  );
77
82
  }
78
83
  };
@@ -81,15 +86,22 @@ export class InstancesImpl implements Instances {
81
86
  private async *listByAccountPagingPage(
82
87
  resourceGroupName: string,
83
88
  accountName: string,
84
- options?: InstancesListByAccountOptionalParams
89
+ options?: InstancesListByAccountOptionalParams,
90
+ settings?: PageSettings
85
91
  ): AsyncIterableIterator<Instance[]> {
86
- let result = await this._listByAccount(
87
- resourceGroupName,
88
- accountName,
89
- options
90
- );
91
- yield result.value || [];
92
- let continuationToken = result.nextLink;
92
+ let result: InstancesListByAccountResponse;
93
+ let continuationToken = settings?.continuationToken;
94
+ if (!continuationToken) {
95
+ result = await this._listByAccount(
96
+ resourceGroupName,
97
+ accountName,
98
+ options
99
+ );
100
+ let page = result.value || [];
101
+ continuationToken = result.nextLink;
102
+ setContinuationToken(page, continuationToken);
103
+ yield page;
104
+ }
93
105
  while (continuationToken) {
94
106
  result = await this._listByAccountNext(
95
107
  resourceGroupName,
@@ -98,7 +110,9 @@ export class InstancesImpl implements Instances {
98
110
  options
99
111
  );
100
112
  continuationToken = result.nextLink;
101
- yield result.value || [];
113
+ let page = result.value || [];
114
+ setContinuationToken(page, continuationToken);
115
+ yield page;
102
116
  }
103
117
  }
104
118
 
@@ -566,7 +580,6 @@ const listByAccountNextOperationSpec: coreClient.OperationSpec = {
566
580
  bodyMapper: Mappers.ErrorResponse
567
581
  }
568
582
  },
569
- queryParameters: [Parameters.apiVersion],
570
583
  urlParameters: [
571
584
  Parameters.$host,
572
585
  Parameters.subscriptionId,
@@ -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";
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationsListOptionalParams
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<Operation[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
130
143
  bodyMapper: Mappers.ErrorResponse
131
144
  }
132
145
  },
133
- queryParameters: [Parameters.apiVersion],
134
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
135
147
  headerParameters: [Parameters.accept],
136
148
  serializer