@azure/arm-elasticsan 1.0.0-alpha.20221219.1 → 1.0.0-alpha.20230111.4

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 (80) hide show
  1. package/CHANGELOG.md +5 -5
  2. package/LICENSE +1 -1
  3. package/dist/index.js +124 -46
  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/elasticSansCreateSample.js +13 -6
  8. package/dist-esm/samples-dev/elasticSansCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/elasticSansDeleteSample.js +13 -6
  10. package/dist-esm/samples-dev/elasticSansDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/elasticSansGetSample.js +13 -6
  12. package/dist-esm/samples-dev/elasticSansGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js +13 -6
  14. package/dist-esm/samples-dev/elasticSansListByResourceGroupSample.js.map +1 -1
  15. package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js +11 -4
  16. package/dist-esm/samples-dev/elasticSansListBySubscriptionSample.js.map +1 -1
  17. package/dist-esm/samples-dev/elasticSansUpdateSample.js +13 -6
  18. package/dist-esm/samples-dev/elasticSansUpdateSample.js.map +1 -1
  19. package/dist-esm/samples-dev/operationsListSample.js +13 -4
  20. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  21. package/dist-esm/samples-dev/skusListSample.js +11 -4
  22. package/dist-esm/samples-dev/skusListSample.js.map +1 -1
  23. package/dist-esm/samples-dev/volumeGroupsCreateSample.js +13 -6
  24. package/dist-esm/samples-dev/volumeGroupsCreateSample.js.map +1 -1
  25. package/dist-esm/samples-dev/volumeGroupsDeleteSample.js +13 -6
  26. package/dist-esm/samples-dev/volumeGroupsDeleteSample.js.map +1 -1
  27. package/dist-esm/samples-dev/volumeGroupsGetSample.js +13 -6
  28. package/dist-esm/samples-dev/volumeGroupsGetSample.js.map +1 -1
  29. package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js +13 -6
  30. package/dist-esm/samples-dev/volumeGroupsListByElasticSanSample.js.map +1 -1
  31. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js +13 -6
  32. package/dist-esm/samples-dev/volumeGroupsUpdateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/volumesCreateSample.js +13 -6
  34. package/dist-esm/samples-dev/volumesCreateSample.js.map +1 -1
  35. package/dist-esm/samples-dev/volumesDeleteSample.js +13 -6
  36. package/dist-esm/samples-dev/volumesDeleteSample.js.map +1 -1
  37. package/dist-esm/samples-dev/volumesGetSample.js +13 -6
  38. package/dist-esm/samples-dev/volumesGetSample.js.map +1 -1
  39. package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js +13 -6
  40. package/dist-esm/samples-dev/volumesListByVolumeGroupSample.js.map +1 -1
  41. package/dist-esm/samples-dev/volumesUpdateSample.js +13 -6
  42. package/dist-esm/samples-dev/volumesUpdateSample.js.map +1 -1
  43. package/dist-esm/src/elasticSanManagement.d.ts.map +1 -1
  44. package/dist-esm/src/elasticSanManagement.js +3 -6
  45. package/dist-esm/src/elasticSanManagement.js.map +1 -1
  46. package/dist-esm/src/index.d.ts +1 -0
  47. package/dist-esm/src/index.d.ts.map +1 -1
  48. package/dist-esm/src/index.js +1 -0
  49. package/dist-esm/src/index.js.map +1 -1
  50. package/dist-esm/src/operations/elasticSans.d.ts.map +1 -1
  51. package/dist-esm/src/operations/elasticSans.js +37 -16
  52. package/dist-esm/src/operations/elasticSans.js.map +1 -1
  53. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  54. package/dist-esm/src/operations/operations.js +8 -4
  55. package/dist-esm/src/operations/operations.js.map +1 -1
  56. package/dist-esm/src/operations/skus.d.ts.map +1 -1
  57. package/dist-esm/src/operations/skus.js +8 -4
  58. package/dist-esm/src/operations/skus.js.map +1 -1
  59. package/dist-esm/src/operations/volumeGroups.d.ts.map +1 -1
  60. package/dist-esm/src/operations/volumeGroups.js +19 -8
  61. package/dist-esm/src/operations/volumeGroups.js.map +1 -1
  62. package/dist-esm/src/operations/volumes.d.ts.map +1 -1
  63. package/dist-esm/src/operations/volumes.js +19 -8
  64. package/dist-esm/src/operations/volumes.js.map +1 -1
  65. package/dist-esm/src/pagingHelper.d.ts +13 -0
  66. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  67. package/dist-esm/src/pagingHelper.js +32 -0
  68. package/dist-esm/src/pagingHelper.js.map +1 -0
  69. package/package.json +4 -3
  70. package/review/arm-elasticsan.api.md +3 -0
  71. package/src/elasticSanManagement.ts +4 -5
  72. package/src/index.ts +1 -0
  73. package/src/operations/elasticSans.ts +45 -18
  74. package/src/operations/operations.ts +10 -5
  75. package/src/operations/skus.ts +10 -5
  76. package/src/operations/volumeGroups.ts +26 -13
  77. package/src/operations/volumes.ts +28 -15
  78. package/src/pagingHelper.ts +39 -0
  79. package/types/arm-elasticsan.d.ts +9 -0
  80. package/types/tsdoc-metadata.json +1 -1
@@ -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 { ElasticSans } 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
  ElasticSan,
19
20
  ElasticSansListBySubscriptionNextOptionalParams,
20
21
  ElasticSansListBySubscriptionOptionalParams,
22
+ ElasticSansListBySubscriptionResponse,
21
23
  ElasticSansListByResourceGroupNextOptionalParams,
22
24
  ElasticSansListByResourceGroupOptionalParams,
23
- ElasticSansListBySubscriptionResponse,
24
25
  ElasticSansListByResourceGroupResponse,
25
26
  ElasticSansCreateOptionalParams,
26
27
  ElasticSansCreateResponse,
@@ -62,22 +63,34 @@ export class ElasticSansImpl implements ElasticSans {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listBySubscriptionPagingPage(options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listBySubscriptionPagingPage(options, settings);
67
71
  }
68
72
  };
69
73
  }
70
74
 
71
75
  private async *listBySubscriptionPagingPage(
72
- options?: ElasticSansListBySubscriptionOptionalParams
76
+ options?: ElasticSansListBySubscriptionOptionalParams,
77
+ settings?: PageSettings
73
78
  ): AsyncIterableIterator<ElasticSan[]> {
74
- let result = await this._listBySubscription(options);
75
- yield result.value || [];
76
- let continuationToken = result.nextLink;
79
+ let result: ElasticSansListBySubscriptionResponse;
80
+ let continuationToken = settings?.continuationToken;
81
+ if (!continuationToken) {
82
+ result = await this._listBySubscription(options);
83
+ let page = result.value || [];
84
+ continuationToken = result.nextLink;
85
+ setContinuationToken(page, continuationToken);
86
+ yield page;
87
+ }
77
88
  while (continuationToken) {
78
89
  result = await this._listBySubscriptionNext(continuationToken, options);
79
90
  continuationToken = result.nextLink;
80
- yield result.value || [];
91
+ let page = result.value || [];
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
81
94
  }
82
95
  }
83
96
 
@@ -106,19 +119,33 @@ export class ElasticSansImpl implements ElasticSans {
106
119
  [Symbol.asyncIterator]() {
107
120
  return this;
108
121
  },
109
- byPage: () => {
110
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
122
+ byPage: (settings?: PageSettings) => {
123
+ if (settings?.maxPageSize) {
124
+ throw new Error("maxPageSize is not supported by this operation.");
125
+ }
126
+ return this.listByResourceGroupPagingPage(
127
+ resourceGroupName,
128
+ options,
129
+ settings
130
+ );
111
131
  }
112
132
  };
113
133
  }
114
134
 
115
135
  private async *listByResourceGroupPagingPage(
116
136
  resourceGroupName: string,
117
- options?: ElasticSansListByResourceGroupOptionalParams
137
+ options?: ElasticSansListByResourceGroupOptionalParams,
138
+ settings?: PageSettings
118
139
  ): AsyncIterableIterator<ElasticSan[]> {
119
- let result = await this._listByResourceGroup(resourceGroupName, options);
120
- yield result.value || [];
121
- let continuationToken = result.nextLink;
140
+ let result: ElasticSansListByResourceGroupResponse;
141
+ let continuationToken = settings?.continuationToken;
142
+ if (!continuationToken) {
143
+ result = await this._listByResourceGroup(resourceGroupName, options);
144
+ let page = result.value || [];
145
+ continuationToken = result.nextLink;
146
+ setContinuationToken(page, continuationToken);
147
+ yield page;
148
+ }
122
149
  while (continuationToken) {
123
150
  result = await this._listByResourceGroupNext(
124
151
  resourceGroupName,
@@ -126,7 +153,9 @@ export class ElasticSansImpl implements ElasticSans {
126
153
  options
127
154
  );
128
155
  continuationToken = result.nextLink;
129
- yield result.value || [];
156
+ let page = result.value || [];
157
+ setContinuationToken(page, continuationToken);
158
+ yield page;
130
159
  }
131
160
  }
132
161
 
@@ -651,7 +680,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
651
680
  bodyMapper: Mappers.ErrorModel
652
681
  }
653
682
  },
654
- queryParameters: [Parameters.apiVersion],
655
683
  urlParameters: [
656
684
  Parameters.$host,
657
685
  Parameters.subscriptionId,
@@ -671,7 +699,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
671
699
  bodyMapper: Mappers.ErrorModel
672
700
  }
673
701
  },
674
- queryParameters: [Parameters.apiVersion],
675
702
  urlParameters: [
676
703
  Parameters.$host,
677
704
  Parameters.subscriptionId,
@@ -6,7 +6,7 @@
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
10
  import { Operations } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -46,16 +46,21 @@ export class OperationsImpl implements Operations {
46
46
  [Symbol.asyncIterator]() {
47
47
  return this;
48
48
  },
49
- byPage: () => {
50
- return this.listPagingPage(options);
49
+ byPage: (settings?: PageSettings) => {
50
+ if (settings?.maxPageSize) {
51
+ throw new Error("maxPageSize is not supported by this operation.");
52
+ }
53
+ return this.listPagingPage(options, settings);
51
54
  }
52
55
  };
53
56
  }
54
57
 
55
58
  private async *listPagingPage(
56
- options?: OperationsListOptionalParams
59
+ options?: OperationsListOptionalParams,
60
+ _settings?: PageSettings
57
61
  ): AsyncIterableIterator<ElasticSanRPOperation[]> {
58
- let result = await this._list(options);
62
+ let result: OperationsListResponse;
63
+ result = await this._list(options);
59
64
  yield result.value || [];
60
65
  }
61
66
 
@@ -6,7 +6,7 @@
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
10
  import { Skus } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -46,16 +46,21 @@ export class SkusImpl implements Skus {
46
46
  [Symbol.asyncIterator]() {
47
47
  return this;
48
48
  },
49
- byPage: () => {
50
- return this.listPagingPage(options);
49
+ byPage: (settings?: PageSettings) => {
50
+ if (settings?.maxPageSize) {
51
+ throw new Error("maxPageSize is not supported by this operation.");
52
+ }
53
+ return this.listPagingPage(options, settings);
51
54
  }
52
55
  };
53
56
  }
54
57
 
55
58
  private async *listPagingPage(
56
- options?: SkusListOptionalParams
59
+ options?: SkusListOptionalParams,
60
+ _settings?: PageSettings
57
61
  ): AsyncIterableIterator<SkuInformation[]> {
58
- let result = await this._list(options);
62
+ let result: SkusListResponse;
63
+ result = await this._list(options);
59
64
  yield result.value || [];
60
65
  }
61
66
 
@@ -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 { VolumeGroups } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -66,11 +67,15 @@ export class VolumeGroupsImpl implements VolumeGroups {
66
67
  [Symbol.asyncIterator]() {
67
68
  return this;
68
69
  },
69
- byPage: () => {
70
+ byPage: (settings?: PageSettings) => {
71
+ if (settings?.maxPageSize) {
72
+ throw new Error("maxPageSize is not supported by this operation.");
73
+ }
70
74
  return this.listByElasticSanPagingPage(
71
75
  resourceGroupName,
72
76
  elasticSanName,
73
- options
77
+ options,
78
+ settings
74
79
  );
75
80
  }
76
81
  };
@@ -79,15 +84,22 @@ export class VolumeGroupsImpl implements VolumeGroups {
79
84
  private async *listByElasticSanPagingPage(
80
85
  resourceGroupName: string,
81
86
  elasticSanName: string,
82
- options?: VolumeGroupsListByElasticSanOptionalParams
87
+ options?: VolumeGroupsListByElasticSanOptionalParams,
88
+ settings?: PageSettings
83
89
  ): AsyncIterableIterator<VolumeGroup[]> {
84
- let result = await this._listByElasticSan(
85
- resourceGroupName,
86
- elasticSanName,
87
- options
88
- );
89
- yield result.value || [];
90
- let continuationToken = result.nextLink;
90
+ let result: VolumeGroupsListByElasticSanResponse;
91
+ let continuationToken = settings?.continuationToken;
92
+ if (!continuationToken) {
93
+ result = await this._listByElasticSan(
94
+ resourceGroupName,
95
+ elasticSanName,
96
+ options
97
+ );
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
91
103
  while (continuationToken) {
92
104
  result = await this._listByElasticSanNext(
93
105
  resourceGroupName,
@@ -96,7 +108,9 @@ export class VolumeGroupsImpl implements VolumeGroups {
96
108
  options
97
109
  );
98
110
  continuationToken = result.nextLink;
99
- yield result.value || [];
111
+ let page = result.value || [];
112
+ setContinuationToken(page, continuationToken);
113
+ yield page;
100
114
  }
101
115
  }
102
116
 
@@ -616,7 +630,6 @@ const listByElasticSanNextOperationSpec: coreClient.OperationSpec = {
616
630
  bodyMapper: Mappers.ErrorModel
617
631
  }
618
632
  },
619
- queryParameters: [Parameters.apiVersion],
620
633
  urlParameters: [
621
634
  Parameters.$host,
622
635
  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 { Volumes } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,6 +19,7 @@ import {
18
19
  Volume,
19
20
  VolumesListByVolumeGroupNextOptionalParams,
20
21
  VolumesListByVolumeGroupOptionalParams,
22
+ VolumesListByVolumeGroupResponse,
21
23
  VolumesCreateOptionalParams,
22
24
  VolumesCreateResponse,
23
25
  VolumeUpdate,
@@ -26,7 +28,6 @@ import {
26
28
  VolumesDeleteOptionalParams,
27
29
  VolumesGetOptionalParams,
28
30
  VolumesGetResponse,
29
- VolumesListByVolumeGroupResponse,
30
31
  VolumesListByVolumeGroupNextResponse
31
32
  } from "../models";
32
33
 
@@ -69,12 +70,16 @@ export class VolumesImpl implements Volumes {
69
70
  [Symbol.asyncIterator]() {
70
71
  return this;
71
72
  },
72
- byPage: () => {
73
+ byPage: (settings?: PageSettings) => {
74
+ if (settings?.maxPageSize) {
75
+ throw new Error("maxPageSize is not supported by this operation.");
76
+ }
73
77
  return this.listByVolumeGroupPagingPage(
74
78
  resourceGroupName,
75
79
  elasticSanName,
76
80
  volumeGroupName,
77
- options
81
+ options,
82
+ settings
78
83
  );
79
84
  }
80
85
  };
@@ -84,16 +89,23 @@ export class VolumesImpl implements Volumes {
84
89
  resourceGroupName: string,
85
90
  elasticSanName: string,
86
91
  volumeGroupName: string,
87
- options?: VolumesListByVolumeGroupOptionalParams
92
+ options?: VolumesListByVolumeGroupOptionalParams,
93
+ settings?: PageSettings
88
94
  ): AsyncIterableIterator<Volume[]> {
89
- let result = await this._listByVolumeGroup(
90
- resourceGroupName,
91
- elasticSanName,
92
- volumeGroupName,
93
- options
94
- );
95
- yield result.value || [];
96
- let continuationToken = result.nextLink;
95
+ let result: VolumesListByVolumeGroupResponse;
96
+ let continuationToken = settings?.continuationToken;
97
+ if (!continuationToken) {
98
+ result = await this._listByVolumeGroup(
99
+ resourceGroupName,
100
+ elasticSanName,
101
+ volumeGroupName,
102
+ options
103
+ );
104
+ let page = result.value || [];
105
+ continuationToken = result.nextLink;
106
+ setContinuationToken(page, continuationToken);
107
+ yield page;
108
+ }
97
109
  while (continuationToken) {
98
110
  result = await this._listByVolumeGroupNext(
99
111
  resourceGroupName,
@@ -103,7 +115,9 @@ export class VolumesImpl implements Volumes {
103
115
  options
104
116
  );
105
117
  continuationToken = result.nextLink;
106
- yield result.value || [];
118
+ let page = result.value || [];
119
+ setContinuationToken(page, continuationToken);
120
+ yield page;
107
121
  }
108
122
  }
109
123
 
@@ -659,7 +673,6 @@ const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = {
659
673
  bodyMapper: Mappers.ErrorModel
660
674
  }
661
675
  },
662
- queryParameters: [Parameters.apiVersion],
663
676
  urlParameters: [
664
677
  Parameters.$host,
665
678
  Parameters.subscriptionId,
@@ -0,0 +1,39 @@
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
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
@@ -343,6 +343,15 @@ export declare interface ErrorResponse {
343
343
  readonly additionalInfo?: ErrorAdditionalInfo[];
344
344
  }
345
345
 
346
+ /**
347
+ * Given the last `.value` produced by the `byPage` iterator,
348
+ * returns a continuation token that can be used to begin paging from
349
+ * that point later.
350
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
351
+ * @returns The continuation token that can be passed into byPage() during future calls.
352
+ */
353
+ export declare function getContinuationToken(page: unknown): string | undefined;
354
+
346
355
  /** Iscsi target information */
347
356
  export declare interface IscsiTargetInfo {
348
357
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.33.6"
8
+ "packageVersion": "7.33.7"
9
9
  }
10
10
  ]
11
11
  }