@azure/arm-storagesync 9.0.2-alpha.20221213.1 → 9.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 (66) hide show
  1. package/CHANGELOG.md +19 -10
  2. package/README.md +7 -7
  3. package/dist/index.js +225 -59
  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/serverEndpointsCreateSample.js +1 -1
  8. package/dist-esm/samples-dev/serverEndpointsCreateSample.js.map +1 -1
  9. package/dist-esm/src/index.d.ts +1 -0
  10. package/dist-esm/src/index.d.ts.map +1 -1
  11. package/dist-esm/src/index.js +1 -0
  12. package/dist-esm/src/index.js.map +1 -1
  13. package/dist-esm/src/microsoftStorageSync.d.ts +2 -0
  14. package/dist-esm/src/microsoftStorageSync.d.ts.map +1 -1
  15. package/dist-esm/src/microsoftStorageSync.js +49 -18
  16. package/dist-esm/src/microsoftStorageSync.js.map +1 -1
  17. package/dist-esm/src/models/index.d.ts +89 -27
  18. package/dist-esm/src/models/index.d.ts.map +1 -1
  19. package/dist-esm/src/models/index.js +61 -0
  20. package/dist-esm/src/models/index.js.map +1 -1
  21. package/dist-esm/src/operations/cloudEndpoints.d.ts.map +1 -1
  22. package/dist-esm/src/operations/cloudEndpoints.js +8 -4
  23. package/dist-esm/src/operations/cloudEndpoints.js.map +1 -1
  24. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  25. package/dist-esm/src/operations/operations.js +19 -8
  26. package/dist-esm/src/operations/operations.js.map +1 -1
  27. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  28. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  29. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  30. package/dist-esm/src/operations/registeredServers.d.ts.map +1 -1
  31. package/dist-esm/src/operations/registeredServers.js +8 -4
  32. package/dist-esm/src/operations/registeredServers.js.map +1 -1
  33. package/dist-esm/src/operations/serverEndpoints.d.ts.map +1 -1
  34. package/dist-esm/src/operations/serverEndpoints.js +8 -4
  35. package/dist-esm/src/operations/serverEndpoints.js.map +1 -1
  36. package/dist-esm/src/operations/storageSyncServices.d.ts.map +1 -1
  37. package/dist-esm/src/operations/storageSyncServices.js +16 -8
  38. package/dist-esm/src/operations/storageSyncServices.js.map +1 -1
  39. package/dist-esm/src/operations/syncGroups.d.ts.map +1 -1
  40. package/dist-esm/src/operations/syncGroups.js +8 -4
  41. package/dist-esm/src/operations/syncGroups.js.map +1 -1
  42. package/dist-esm/src/operations/workflows.d.ts.map +1 -1
  43. package/dist-esm/src/operations/workflows.js +8 -4
  44. package/dist-esm/src/operations/workflows.js.map +1 -1
  45. package/dist-esm/src/pagingHelper.d.ts +13 -0
  46. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  47. package/dist-esm/src/pagingHelper.js +32 -0
  48. package/dist-esm/src/pagingHelper.js.map +1 -0
  49. package/dist-esm/test/sampleTest.js +11 -13
  50. package/dist-esm/test/sampleTest.js.map +1 -1
  51. package/package.json +13 -9
  52. package/review/arm-storagesync.api.md +89 -146
  53. package/src/index.ts +1 -0
  54. package/src/microsoftStorageSync.ts +60 -20
  55. package/src/models/index.ts +88 -27
  56. package/src/operations/cloudEndpoints.ts +12 -6
  57. package/src/operations/operations.ts +21 -9
  58. package/src/operations/privateEndpointConnections.ts +13 -7
  59. package/src/operations/registeredServers.ts +11 -5
  60. package/src/operations/serverEndpoints.ts +12 -6
  61. package/src/operations/storageSyncServices.ts +26 -12
  62. package/src/operations/syncGroups.ts +11 -5
  63. package/src/operations/workflows.ts +11 -5
  64. package/src/pagingHelper.ts +39 -0
  65. package/types/arm-storagesync.d.ts +100 -27
  66. package/types/tsdoc-metadata.json +1 -1
@@ -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 { RegisteredServers } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -66,11 +66,15 @@ export class RegisteredServersImpl implements RegisteredServers {
66
66
  [Symbol.asyncIterator]() {
67
67
  return this;
68
68
  },
69
- byPage: () => {
69
+ byPage: (settings?: PageSettings) => {
70
+ if (settings?.maxPageSize) {
71
+ throw new Error("maxPageSize is not supported by this operation.");
72
+ }
70
73
  return this.listByStorageSyncServicePagingPage(
71
74
  resourceGroupName,
72
75
  storageSyncServiceName,
73
- options
76
+ options,
77
+ settings
74
78
  );
75
79
  }
76
80
  };
@@ -79,9 +83,11 @@ export class RegisteredServersImpl implements RegisteredServers {
79
83
  private async *listByStorageSyncServicePagingPage(
80
84
  resourceGroupName: string,
81
85
  storageSyncServiceName: string,
82
- options?: RegisteredServersListByStorageSyncServiceOptionalParams
86
+ options?: RegisteredServersListByStorageSyncServiceOptionalParams,
87
+ _settings?: PageSettings
83
88
  ): AsyncIterableIterator<RegisteredServer[]> {
84
- let result = await this._listByStorageSyncService(
89
+ let result: RegisteredServersListByStorageSyncServiceResponse;
90
+ result = await this._listByStorageSyncService(
85
91
  resourceGroupName,
86
92
  storageSyncServiceName,
87
93
  options
@@ -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 { ServerEndpoints } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -17,6 +17,7 @@ import { LroImpl } from "../lroImpl";
17
17
  import {
18
18
  ServerEndpoint,
19
19
  ServerEndpointsListBySyncGroupOptionalParams,
20
+ ServerEndpointsListBySyncGroupResponse,
20
21
  ServerEndpointCreateParameters,
21
22
  ServerEndpointsCreateOptionalParams,
22
23
  ServerEndpointsCreateResponse,
@@ -26,7 +27,6 @@ import {
26
27
  ServerEndpointsGetResponse,
27
28
  ServerEndpointsDeleteOptionalParams,
28
29
  ServerEndpointsDeleteResponse,
29
- ServerEndpointsListBySyncGroupResponse,
30
30
  RecallActionParameters,
31
31
  ServerEndpointsRecallActionOptionalParams,
32
32
  ServerEndpointsRecallActionResponse
@@ -71,12 +71,16 @@ export class ServerEndpointsImpl implements ServerEndpoints {
71
71
  [Symbol.asyncIterator]() {
72
72
  return this;
73
73
  },
74
- byPage: () => {
74
+ byPage: (settings?: PageSettings) => {
75
+ if (settings?.maxPageSize) {
76
+ throw new Error("maxPageSize is not supported by this operation.");
77
+ }
75
78
  return this.listBySyncGroupPagingPage(
76
79
  resourceGroupName,
77
80
  storageSyncServiceName,
78
81
  syncGroupName,
79
- options
82
+ options,
83
+ settings
80
84
  );
81
85
  }
82
86
  };
@@ -86,9 +90,11 @@ export class ServerEndpointsImpl implements ServerEndpoints {
86
90
  resourceGroupName: string,
87
91
  storageSyncServiceName: string,
88
92
  syncGroupName: string,
89
- options?: ServerEndpointsListBySyncGroupOptionalParams
93
+ options?: ServerEndpointsListBySyncGroupOptionalParams,
94
+ _settings?: PageSettings
90
95
  ): AsyncIterableIterator<ServerEndpoint[]> {
91
- let result = await this._listBySyncGroup(
96
+ let result: ServerEndpointsListBySyncGroupResponse;
97
+ result = await this._listBySyncGroup(
92
98
  resourceGroupName,
93
99
  storageSyncServiceName,
94
100
  syncGroupName,
@@ -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 { StorageSyncServices } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -17,7 +17,9 @@ import { LroImpl } from "../lroImpl";
17
17
  import {
18
18
  StorageSyncService,
19
19
  StorageSyncServicesListByResourceGroupOptionalParams,
20
+ StorageSyncServicesListByResourceGroupResponse,
20
21
  StorageSyncServicesListBySubscriptionOptionalParams,
22
+ StorageSyncServicesListBySubscriptionResponse,
21
23
  CheckNameAvailabilityParameters,
22
24
  StorageSyncServicesCheckNameAvailabilityOptionalParams,
23
25
  StorageSyncServicesCheckNameAvailabilityResponse,
@@ -29,9 +31,7 @@ import {
29
31
  StorageSyncServicesUpdateOptionalParams,
30
32
  StorageSyncServicesUpdateResponse,
31
33
  StorageSyncServicesDeleteOptionalParams,
32
- StorageSyncServicesDeleteResponse,
33
- StorageSyncServicesListByResourceGroupResponse,
34
- StorageSyncServicesListBySubscriptionResponse
34
+ StorageSyncServicesDeleteResponse
35
35
  } from "../models";
36
36
 
37
37
  /// <reference lib="esnext.asynciterable" />
@@ -64,17 +64,26 @@ export class StorageSyncServicesImpl implements StorageSyncServices {
64
64
  [Symbol.asyncIterator]() {
65
65
  return this;
66
66
  },
67
- byPage: () => {
68
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
67
+ byPage: (settings?: PageSettings) => {
68
+ if (settings?.maxPageSize) {
69
+ throw new Error("maxPageSize is not supported by this operation.");
70
+ }
71
+ return this.listByResourceGroupPagingPage(
72
+ resourceGroupName,
73
+ options,
74
+ settings
75
+ );
69
76
  }
70
77
  };
71
78
  }
72
79
 
73
80
  private async *listByResourceGroupPagingPage(
74
81
  resourceGroupName: string,
75
- options?: StorageSyncServicesListByResourceGroupOptionalParams
82
+ options?: StorageSyncServicesListByResourceGroupOptionalParams,
83
+ _settings?: PageSettings
76
84
  ): AsyncIterableIterator<StorageSyncService[]> {
77
- let result = await this._listByResourceGroup(resourceGroupName, options);
85
+ let result: StorageSyncServicesListByResourceGroupResponse;
86
+ result = await this._listByResourceGroup(resourceGroupName, options);
78
87
  yield result.value || [];
79
88
  }
80
89
 
@@ -105,16 +114,21 @@ export class StorageSyncServicesImpl implements StorageSyncServices {
105
114
  [Symbol.asyncIterator]() {
106
115
  return this;
107
116
  },
108
- byPage: () => {
109
- return this.listBySubscriptionPagingPage(options);
117
+ byPage: (settings?: PageSettings) => {
118
+ if (settings?.maxPageSize) {
119
+ throw new Error("maxPageSize is not supported by this operation.");
120
+ }
121
+ return this.listBySubscriptionPagingPage(options, settings);
110
122
  }
111
123
  };
112
124
  }
113
125
 
114
126
  private async *listBySubscriptionPagingPage(
115
- options?: StorageSyncServicesListBySubscriptionOptionalParams
127
+ options?: StorageSyncServicesListBySubscriptionOptionalParams,
128
+ _settings?: PageSettings
116
129
  ): AsyncIterableIterator<StorageSyncService[]> {
117
- let result = await this._listBySubscription(options);
130
+ let result: StorageSyncServicesListBySubscriptionResponse;
131
+ result = await this._listBySubscription(options);
118
132
  yield result.value || [];
119
133
  }
120
134
 
@@ -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 { SyncGroups } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -61,11 +61,15 @@ export class SyncGroupsImpl implements SyncGroups {
61
61
  [Symbol.asyncIterator]() {
62
62
  return this;
63
63
  },
64
- byPage: () => {
64
+ byPage: (settings?: PageSettings) => {
65
+ if (settings?.maxPageSize) {
66
+ throw new Error("maxPageSize is not supported by this operation.");
67
+ }
65
68
  return this.listByStorageSyncServicePagingPage(
66
69
  resourceGroupName,
67
70
  storageSyncServiceName,
68
- options
71
+ options,
72
+ settings
69
73
  );
70
74
  }
71
75
  };
@@ -74,9 +78,11 @@ export class SyncGroupsImpl implements SyncGroups {
74
78
  private async *listByStorageSyncServicePagingPage(
75
79
  resourceGroupName: string,
76
80
  storageSyncServiceName: string,
77
- options?: SyncGroupsListByStorageSyncServiceOptionalParams
81
+ options?: SyncGroupsListByStorageSyncServiceOptionalParams,
82
+ _settings?: PageSettings
78
83
  ): AsyncIterableIterator<SyncGroup[]> {
79
- let result = await this._listByStorageSyncService(
84
+ let result: SyncGroupsListByStorageSyncServiceResponse;
85
+ result = await this._listByStorageSyncService(
80
86
  resourceGroupName,
81
87
  storageSyncServiceName,
82
88
  options
@@ -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 { Workflows } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -58,11 +58,15 @@ export class WorkflowsImpl implements Workflows {
58
58
  [Symbol.asyncIterator]() {
59
59
  return this;
60
60
  },
61
- byPage: () => {
61
+ byPage: (settings?: PageSettings) => {
62
+ if (settings?.maxPageSize) {
63
+ throw new Error("maxPageSize is not supported by this operation.");
64
+ }
62
65
  return this.listByStorageSyncServicePagingPage(
63
66
  resourceGroupName,
64
67
  storageSyncServiceName,
65
- options
68
+ options,
69
+ settings
66
70
  );
67
71
  }
68
72
  };
@@ -71,9 +75,11 @@ export class WorkflowsImpl implements Workflows {
71
75
  private async *listByStorageSyncServicePagingPage(
72
76
  resourceGroupName: string,
73
77
  storageSyncServiceName: string,
74
- options?: WorkflowsListByStorageSyncServiceOptionalParams
78
+ options?: WorkflowsListByStorageSyncServiceOptionalParams,
79
+ _settings?: PageSettings
75
80
  ): AsyncIterableIterator<Workflow[]> {
76
- let result = await this._listByStorageSyncService(
81
+ let result: WorkflowsListByStorageSyncServiceResponse;
82
+ result = await this._listByStorageSyncService(
77
83
  resourceGroupName,
78
84
  storageSyncServiceName,
79
85
  options
@@ -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
+ }