@azure/arm-storagediscovery 1.0.0-beta.1
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.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/operations/index.d.ts +3 -0
- package/dist/browser/api/operations/index.js +4 -0
- package/dist/browser/api/operations/index.js.map +1 -0
- package/dist/browser/api/operations/operations.d.ts +10 -0
- package/dist/browser/api/operations/operations.js +29 -0
- package/dist/browser/api/operations/operations.js.map +1 -0
- package/dist/browser/api/operations/options.d.ts +5 -0
- package/dist/browser/api/operations/options.js +4 -0
- package/dist/browser/api/operations/options.js.map +1 -0
- package/dist/browser/api/storageDiscoveryContext.d.ts +19 -0
- package/dist/browser/api/storageDiscoveryContext.js +36 -0
- package/dist/browser/api/storageDiscoveryContext.js.map +1 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/index.d.ts +3 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/index.js +4 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/operations.d.ts +35 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/operations.js +183 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/operations.js.map +1 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/options.d.ts +20 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/options.js +4 -0
- package/dist/browser/api/storageDiscoveryWorkspaces/options.js.map +1 -0
- package/dist/browser/classic/index.d.ts +3 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/classic/operations/index.d.ts +11 -0
- package/dist/browser/classic/operations/index.js +12 -0
- package/dist/browser/classic/operations/index.js.map +1 -0
- package/dist/browser/classic/storageDiscoveryWorkspaces/index.d.ts +26 -0
- package/dist/browser/classic/storageDiscoveryWorkspaces/index.js +17 -0
- package/dist/browser/classic/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/browser/index.d.ts +9 -0
- package/dist/browser/index.js +5 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +277 -0
- package/dist/browser/models/models.js +279 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/browser/static-helpers/pagingHelpers.js +137 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +169 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/browser/storageDiscoveryClient.d.ts +18 -0
- package/dist/browser/storageDiscoveryClient.js +20 -0
- package/dist/browser/storageDiscoveryClient.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.js +8 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/api/operations/index.d.ts +3 -0
- package/dist/commonjs/api/operations/index.js +8 -0
- package/dist/commonjs/api/operations/index.js.map +1 -0
- package/dist/commonjs/api/operations/operations.d.ts +10 -0
- package/dist/commonjs/api/operations/operations.js +34 -0
- package/dist/commonjs/api/operations/operations.js.map +1 -0
- package/dist/commonjs/api/operations/options.d.ts +5 -0
- package/dist/commonjs/api/operations/options.js +5 -0
- package/dist/commonjs/api/operations/options.js.map +1 -0
- package/dist/commonjs/api/storageDiscoveryContext.d.ts +19 -0
- package/dist/commonjs/api/storageDiscoveryContext.js +39 -0
- package/dist/commonjs/api/storageDiscoveryContext.js.map +1 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/index.d.ts +3 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/index.js +13 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/operations.d.ts +35 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/operations.js +203 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/operations.js.map +1 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/options.d.ts +20 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/options.js +5 -0
- package/dist/commonjs/api/storageDiscoveryWorkspaces/options.js.map +1 -0
- package/dist/commonjs/classic/index.d.ts +3 -0
- package/dist/commonjs/classic/index.js +5 -0
- package/dist/commonjs/classic/index.js.map +1 -0
- package/dist/commonjs/classic/operations/index.d.ts +11 -0
- package/dist/commonjs/classic/operations/index.js +15 -0
- package/dist/commonjs/classic/operations/index.js.map +1 -0
- package/dist/commonjs/classic/storageDiscoveryWorkspaces/index.d.ts +26 -0
- package/dist/commonjs/classic/storageDiscoveryWorkspaces/index.js +20 -0
- package/dist/commonjs/classic/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/commonjs/index.d.ts +9 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.js +14 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +277 -0
- package/dist/commonjs/models/models.js +309 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +140 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +172 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/storageDiscoveryClient.d.ts +18 -0
- package/dist/commonjs/storageDiscoveryClient.js +24 -0
- package/dist/commonjs/storageDiscoveryClient.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/operations/index.d.ts +3 -0
- package/dist/esm/api/operations/index.js +4 -0
- package/dist/esm/api/operations/index.js.map +1 -0
- package/dist/esm/api/operations/operations.d.ts +10 -0
- package/dist/esm/api/operations/operations.js +29 -0
- package/dist/esm/api/operations/operations.js.map +1 -0
- package/dist/esm/api/operations/options.d.ts +5 -0
- package/dist/esm/api/operations/options.js +4 -0
- package/dist/esm/api/operations/options.js.map +1 -0
- package/dist/esm/api/storageDiscoveryContext.d.ts +19 -0
- package/dist/esm/api/storageDiscoveryContext.js +36 -0
- package/dist/esm/api/storageDiscoveryContext.js.map +1 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/index.d.ts +3 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/index.js +4 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/operations.d.ts +35 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/operations.js +183 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/operations.js.map +1 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/options.d.ts +20 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/options.js +4 -0
- package/dist/esm/api/storageDiscoveryWorkspaces/options.js.map +1 -0
- package/dist/esm/classic/index.d.ts +3 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/classic/operations/index.d.ts +11 -0
- package/dist/esm/classic/operations/index.js +12 -0
- package/dist/esm/classic/operations/index.js.map +1 -0
- package/dist/esm/classic/storageDiscoveryWorkspaces/index.d.ts +26 -0
- package/dist/esm/classic/storageDiscoveryWorkspaces/index.js +17 -0
- package/dist/esm/classic/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +277 -0
- package/dist/esm/models/models.js +279 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/esm/static-helpers/pagingHelpers.js +137 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +169 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/esm/storageDiscoveryClient.d.ts +18 -0
- package/dist/esm/storageDiscoveryClient.js +20 -0
- package/dist/esm/storageDiscoveryClient.js.map +1 -0
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.js +4 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/operations/index.d.ts +3 -0
- package/dist/react-native/api/operations/index.js +4 -0
- package/dist/react-native/api/operations/index.js.map +1 -0
- package/dist/react-native/api/operations/operations.d.ts +10 -0
- package/dist/react-native/api/operations/operations.js +29 -0
- package/dist/react-native/api/operations/operations.js.map +1 -0
- package/dist/react-native/api/operations/options.d.ts +5 -0
- package/dist/react-native/api/operations/options.js +4 -0
- package/dist/react-native/api/operations/options.js.map +1 -0
- package/dist/react-native/api/storageDiscoveryContext.d.ts +19 -0
- package/dist/react-native/api/storageDiscoveryContext.js +36 -0
- package/dist/react-native/api/storageDiscoveryContext.js.map +1 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/index.d.ts +3 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/index.js +4 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/operations.d.ts +35 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/operations.js +183 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/operations.js.map +1 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/options.d.ts +20 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/options.js +4 -0
- package/dist/react-native/api/storageDiscoveryWorkspaces/options.js.map +1 -0
- package/dist/react-native/classic/index.d.ts +3 -0
- package/dist/react-native/classic/index.js +4 -0
- package/dist/react-native/classic/index.js.map +1 -0
- package/dist/react-native/classic/operations/index.d.ts +11 -0
- package/dist/react-native/classic/operations/index.js +12 -0
- package/dist/react-native/classic/operations/index.js.map +1 -0
- package/dist/react-native/classic/storageDiscoveryWorkspaces/index.d.ts +26 -0
- package/dist/react-native/classic/storageDiscoveryWorkspaces/index.js +17 -0
- package/dist/react-native/classic/storageDiscoveryWorkspaces/index.js.map +1 -0
- package/dist/react-native/index.d.ts +9 -0
- package/dist/react-native/index.js +5 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models/index.d.ts +2 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +277 -0
- package/dist/react-native/models/models.js +279 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +137 -0
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.js +169 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/storageDiscoveryClient.d.ts +18 -0
- package/dist/react-native/storageDiscoveryClient.js +20 -0
- package/dist/react-native/storageDiscoveryClient.js.map +1 -0
- package/package.json +212 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export function storageDiscoveryWorkspaceSerializer(item) {
|
|
4
|
+
return {
|
|
5
|
+
tags: item["tags"],
|
|
6
|
+
location: item["location"],
|
|
7
|
+
properties: !item["properties"]
|
|
8
|
+
? item["properties"]
|
|
9
|
+
: storageDiscoveryWorkspacePropertiesSerializer(item["properties"]),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function storageDiscoveryWorkspaceDeserializer(item) {
|
|
13
|
+
return {
|
|
14
|
+
tags: item["tags"],
|
|
15
|
+
location: item["location"],
|
|
16
|
+
id: item["id"],
|
|
17
|
+
name: item["name"],
|
|
18
|
+
type: item["type"],
|
|
19
|
+
systemData: !item["systemData"]
|
|
20
|
+
? item["systemData"]
|
|
21
|
+
: systemDataDeserializer(item["systemData"]),
|
|
22
|
+
properties: !item["properties"]
|
|
23
|
+
? item["properties"]
|
|
24
|
+
: storageDiscoveryWorkspacePropertiesDeserializer(item["properties"]),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function storageDiscoveryWorkspacePropertiesSerializer(item) {
|
|
28
|
+
return {
|
|
29
|
+
sku: item["sku"],
|
|
30
|
+
description: item["description"],
|
|
31
|
+
workspaceRoots: item["workspaceRoots"].map((p) => {
|
|
32
|
+
return p;
|
|
33
|
+
}),
|
|
34
|
+
scopes: storageDiscoveryScopeArraySerializer(item["scopes"]),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function storageDiscoveryWorkspacePropertiesDeserializer(item) {
|
|
38
|
+
return {
|
|
39
|
+
sku: item["sku"],
|
|
40
|
+
description: item["description"],
|
|
41
|
+
workspaceRoots: item["workspaceRoots"].map((p) => {
|
|
42
|
+
return p;
|
|
43
|
+
}),
|
|
44
|
+
scopes: storageDiscoveryScopeArrayDeserializer(item["scopes"]),
|
|
45
|
+
provisioningState: item["provisioningState"],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Storage Discovery Sku */
|
|
49
|
+
export var KnownStorageDiscoverySku;
|
|
50
|
+
(function (KnownStorageDiscoverySku) {
|
|
51
|
+
/** Standard Sku */
|
|
52
|
+
KnownStorageDiscoverySku["Standard"] = "Standard";
|
|
53
|
+
/** Free Sku */
|
|
54
|
+
KnownStorageDiscoverySku["Free"] = "Free";
|
|
55
|
+
})(KnownStorageDiscoverySku || (KnownStorageDiscoverySku = {}));
|
|
56
|
+
export function storageDiscoveryScopeArraySerializer(result) {
|
|
57
|
+
return result.map((item) => {
|
|
58
|
+
return storageDiscoveryScopeSerializer(item);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export function storageDiscoveryScopeArrayDeserializer(result) {
|
|
62
|
+
return result.map((item) => {
|
|
63
|
+
return storageDiscoveryScopeDeserializer(item);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
export function storageDiscoveryScopeSerializer(item) {
|
|
67
|
+
return {
|
|
68
|
+
displayName: item["displayName"],
|
|
69
|
+
resourceTypes: item["resourceTypes"].map((p) => {
|
|
70
|
+
return p;
|
|
71
|
+
}),
|
|
72
|
+
tagKeysOnly: !item["tagKeysOnly"]
|
|
73
|
+
? item["tagKeysOnly"]
|
|
74
|
+
: item["tagKeysOnly"].map((p) => {
|
|
75
|
+
return p;
|
|
76
|
+
}),
|
|
77
|
+
tags: item["tags"],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function storageDiscoveryScopeDeserializer(item) {
|
|
81
|
+
return {
|
|
82
|
+
displayName: item["displayName"],
|
|
83
|
+
resourceTypes: item["resourceTypes"].map((p) => {
|
|
84
|
+
return p;
|
|
85
|
+
}),
|
|
86
|
+
tagKeysOnly: !item["tagKeysOnly"]
|
|
87
|
+
? item["tagKeysOnly"]
|
|
88
|
+
: item["tagKeysOnly"].map((p) => {
|
|
89
|
+
return p;
|
|
90
|
+
}),
|
|
91
|
+
tags: item["tags"],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Storage Discovery Resource Type */
|
|
95
|
+
export var KnownStorageDiscoveryResourceType;
|
|
96
|
+
(function (KnownStorageDiscoveryResourceType) {
|
|
97
|
+
/** Storage Account Resource Type */
|
|
98
|
+
KnownStorageDiscoveryResourceType["StorageAccounts"] = "Microsoft.Storage/storageAccounts";
|
|
99
|
+
})(KnownStorageDiscoveryResourceType || (KnownStorageDiscoveryResourceType = {}));
|
|
100
|
+
/** The provisioning state of a resource type. */
|
|
101
|
+
export var KnownResourceProvisioningState;
|
|
102
|
+
(function (KnownResourceProvisioningState) {
|
|
103
|
+
/** Resource has been created. */
|
|
104
|
+
KnownResourceProvisioningState["Succeeded"] = "Succeeded";
|
|
105
|
+
/** Resource creation failed. */
|
|
106
|
+
KnownResourceProvisioningState["Failed"] = "Failed";
|
|
107
|
+
/** Resource creation was canceled. */
|
|
108
|
+
KnownResourceProvisioningState["Canceled"] = "Canceled";
|
|
109
|
+
})(KnownResourceProvisioningState || (KnownResourceProvisioningState = {}));
|
|
110
|
+
export function trackedResourceSerializer(item) {
|
|
111
|
+
return { tags: item["tags"], location: item["location"] };
|
|
112
|
+
}
|
|
113
|
+
export function trackedResourceDeserializer(item) {
|
|
114
|
+
return {
|
|
115
|
+
id: item["id"],
|
|
116
|
+
name: item["name"],
|
|
117
|
+
type: item["type"],
|
|
118
|
+
systemData: !item["systemData"]
|
|
119
|
+
? item["systemData"]
|
|
120
|
+
: systemDataDeserializer(item["systemData"]),
|
|
121
|
+
tags: item["tags"],
|
|
122
|
+
location: item["location"],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function resourceSerializer(item) {
|
|
126
|
+
return item;
|
|
127
|
+
}
|
|
128
|
+
export function resourceDeserializer(item) {
|
|
129
|
+
return {
|
|
130
|
+
id: item["id"],
|
|
131
|
+
name: item["name"],
|
|
132
|
+
type: item["type"],
|
|
133
|
+
systemData: !item["systemData"]
|
|
134
|
+
? item["systemData"]
|
|
135
|
+
: systemDataDeserializer(item["systemData"]),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export function systemDataDeserializer(item) {
|
|
139
|
+
return {
|
|
140
|
+
createdBy: item["createdBy"],
|
|
141
|
+
createdByType: item["createdByType"],
|
|
142
|
+
createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]),
|
|
143
|
+
lastModifiedBy: item["lastModifiedBy"],
|
|
144
|
+
lastModifiedByType: item["lastModifiedByType"],
|
|
145
|
+
lastModifiedAt: !item["lastModifiedAt"]
|
|
146
|
+
? item["lastModifiedAt"]
|
|
147
|
+
: new Date(item["lastModifiedAt"]),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** The kind of entity that created the resource. */
|
|
151
|
+
export var KnownCreatedByType;
|
|
152
|
+
(function (KnownCreatedByType) {
|
|
153
|
+
/** The entity was created by a user. */
|
|
154
|
+
KnownCreatedByType["User"] = "User";
|
|
155
|
+
/** The entity was created by an application. */
|
|
156
|
+
KnownCreatedByType["Application"] = "Application";
|
|
157
|
+
/** The entity was created by a managed identity. */
|
|
158
|
+
KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
|
|
159
|
+
/** The entity was created by a key. */
|
|
160
|
+
KnownCreatedByType["Key"] = "Key";
|
|
161
|
+
})(KnownCreatedByType || (KnownCreatedByType = {}));
|
|
162
|
+
export function errorResponseDeserializer(item) {
|
|
163
|
+
return {
|
|
164
|
+
error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export function errorDetailDeserializer(item) {
|
|
168
|
+
return {
|
|
169
|
+
code: item["code"],
|
|
170
|
+
message: item["message"],
|
|
171
|
+
target: item["target"],
|
|
172
|
+
details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]),
|
|
173
|
+
additionalInfo: !item["additionalInfo"]
|
|
174
|
+
? item["additionalInfo"]
|
|
175
|
+
: errorAdditionalInfoArrayDeserializer(item["additionalInfo"]),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
export function errorDetailArrayDeserializer(result) {
|
|
179
|
+
return result.map((item) => {
|
|
180
|
+
return errorDetailDeserializer(item);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export function errorAdditionalInfoArrayDeserializer(result) {
|
|
184
|
+
return result.map((item) => {
|
|
185
|
+
return errorAdditionalInfoDeserializer(item);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
export function errorAdditionalInfoDeserializer(item) {
|
|
189
|
+
return {
|
|
190
|
+
type: item["type"],
|
|
191
|
+
info: item["info"],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
export function storageDiscoveryWorkspaceUpdateSerializer(item) {
|
|
195
|
+
return {
|
|
196
|
+
tags: item["tags"],
|
|
197
|
+
properties: !item["properties"]
|
|
198
|
+
? item["properties"]
|
|
199
|
+
: storageDiscoveryWorkspacePropertiesUpdateSerializer(item["properties"]),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export function storageDiscoveryWorkspacePropertiesUpdateSerializer(item) {
|
|
203
|
+
return {
|
|
204
|
+
sku: item["sku"],
|
|
205
|
+
description: item["description"],
|
|
206
|
+
workspaceRoots: !item["workspaceRoots"]
|
|
207
|
+
? item["workspaceRoots"]
|
|
208
|
+
: item["workspaceRoots"].map((p) => {
|
|
209
|
+
return p;
|
|
210
|
+
}),
|
|
211
|
+
scopes: !item["scopes"] ? item["scopes"] : storageDiscoveryScopeArraySerializer(item["scopes"]),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
export function _storageDiscoveryWorkspaceListResultDeserializer(item) {
|
|
215
|
+
return {
|
|
216
|
+
value: storageDiscoveryWorkspaceArrayDeserializer(item["value"]),
|
|
217
|
+
nextLink: item["nextLink"],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export function storageDiscoveryWorkspaceArraySerializer(result) {
|
|
221
|
+
return result.map((item) => {
|
|
222
|
+
return storageDiscoveryWorkspaceSerializer(item);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
export function storageDiscoveryWorkspaceArrayDeserializer(result) {
|
|
226
|
+
return result.map((item) => {
|
|
227
|
+
return storageDiscoveryWorkspaceDeserializer(item);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
export function _operationListResultDeserializer(item) {
|
|
231
|
+
return {
|
|
232
|
+
value: operationArrayDeserializer(item["value"]),
|
|
233
|
+
nextLink: item["nextLink"],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
export function operationArrayDeserializer(result) {
|
|
237
|
+
return result.map((item) => {
|
|
238
|
+
return operationDeserializer(item);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
export function operationDeserializer(item) {
|
|
242
|
+
return {
|
|
243
|
+
name: item["name"],
|
|
244
|
+
isDataAction: item["isDataAction"],
|
|
245
|
+
display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]),
|
|
246
|
+
origin: item["origin"],
|
|
247
|
+
actionType: item["actionType"],
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export function operationDisplayDeserializer(item) {
|
|
251
|
+
return {
|
|
252
|
+
provider: item["provider"],
|
|
253
|
+
resource: item["resource"],
|
|
254
|
+
operation: item["operation"],
|
|
255
|
+
description: item["description"],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */
|
|
259
|
+
export var KnownOrigin;
|
|
260
|
+
(function (KnownOrigin) {
|
|
261
|
+
/** Indicates the operation is initiated by a user. */
|
|
262
|
+
KnownOrigin["User"] = "user";
|
|
263
|
+
/** Indicates the operation is initiated by a system. */
|
|
264
|
+
KnownOrigin["System"] = "system";
|
|
265
|
+
/** Indicates the operation is initiated by a user or system. */
|
|
266
|
+
KnownOrigin["UserSystem"] = "user,system";
|
|
267
|
+
})(KnownOrigin || (KnownOrigin = {}));
|
|
268
|
+
/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */
|
|
269
|
+
export var KnownActionType;
|
|
270
|
+
(function (KnownActionType) {
|
|
271
|
+
/** Actions are for internal-only APIs. */
|
|
272
|
+
KnownActionType["Internal"] = "Internal";
|
|
273
|
+
})(KnownActionType || (KnownActionType = {}));
|
|
274
|
+
/** Known values of {@link ApiVersion} that the service accepts. */
|
|
275
|
+
export var KnownApiVersion;
|
|
276
|
+
(function (KnownApiVersion) {
|
|
277
|
+
KnownApiVersion["V20250601Preview"] = "2025-06-01-preview";
|
|
278
|
+
})(KnownApiVersion || (KnownApiVersion = {}));
|
|
279
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,MAAM,UAAU,mCAAmC,CAAC,IAA+B;IACjF,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QAClB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,UAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;YACpB,CAAC,CAAC,6CAA6C,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qCAAqC,CAAC,IAAS;IAC7D,OAAO;QACL,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C,aAAa,CAAC;KACjC,CAAC;AACJ,CAAC;AAED,2IAA2I;AAC3I,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,sDAAsD;IACtD,4BAAa,CAAA;IACb,wDAAwD;IACxD,gCAAiB,CAAA;IACjB,gEAAgE;IAChE,yCAA0B,CAAA;AAC5B,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAaD,gHAAgH;AAChH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAA0C;IAC1C,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAWD,mEAAmE;AACnE,MAAM,CAAN,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,0DAAuC,CAAA;AACzC,CAAC,EAFW,eAAe,KAAf,eAAe,QAE1B","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A Storage Discovery Workspace resource. This resource configures the collection of storage account metrics. */\nexport interface StorageDiscoveryWorkspace extends TrackedResource {\n /** The resource-specific properties for this resource. */\n properties?: StorageDiscoveryWorkspaceProperties;\n}\n\nexport function storageDiscoveryWorkspaceSerializer(item: StorageDiscoveryWorkspace): any {\n return {\n tags: item[\"tags\"],\n location: item[\"location\"],\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : storageDiscoveryWorkspacePropertiesSerializer(item[\"properties\"]),\n };\n}\n\nexport function storageDiscoveryWorkspaceDeserializer(item: any): StorageDiscoveryWorkspace {\n return {\n tags: item[\"tags\"],\n location: item[\"location\"],\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : storageDiscoveryWorkspacePropertiesDeserializer(item[\"properties\"]),\n };\n}\n\n/** Storage Discovery Workspace Properties */\nexport interface StorageDiscoveryWorkspaceProperties {\n /** The storage discovery sku */\n sku?: StorageDiscoverySku;\n /** The description of the storage discovery workspace */\n description?: string;\n /** The view level storage discovery data estate */\n workspaceRoots: string[];\n /** The scopes of the storage discovery workspace. */\n scopes: StorageDiscoveryScope[];\n /** The status of the last operation. */\n readonly provisioningState?: ResourceProvisioningState;\n}\n\nexport function storageDiscoveryWorkspacePropertiesSerializer(\n item: StorageDiscoveryWorkspaceProperties,\n): any {\n return {\n sku: item[\"sku\"],\n description: item[\"description\"],\n workspaceRoots: item[\"workspaceRoots\"].map((p: any) => {\n return p;\n }),\n scopes: storageDiscoveryScopeArraySerializer(item[\"scopes\"]),\n };\n}\n\nexport function storageDiscoveryWorkspacePropertiesDeserializer(\n item: any,\n): StorageDiscoveryWorkspaceProperties {\n return {\n sku: item[\"sku\"],\n description: item[\"description\"],\n workspaceRoots: item[\"workspaceRoots\"].map((p: any) => {\n return p;\n }),\n scopes: storageDiscoveryScopeArrayDeserializer(item[\"scopes\"]),\n provisioningState: item[\"provisioningState\"],\n };\n}\n\n/** Storage Discovery Sku */\nexport enum KnownStorageDiscoverySku {\n /** Standard Sku */\n Standard = \"Standard\",\n /** Free Sku */\n Free = \"Free\",\n}\n\n/**\n * Storage Discovery Sku \\\n * {@link KnownStorageDiscoverySku} can be used interchangeably with StorageDiscoverySku,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Standard**: Standard Sku \\\n * **Free**: Free Sku\n */\nexport type StorageDiscoverySku = string;\n\nexport function storageDiscoveryScopeArraySerializer(result: Array<StorageDiscoveryScope>): any[] {\n return result.map((item) => {\n return storageDiscoveryScopeSerializer(item);\n });\n}\n\nexport function storageDiscoveryScopeArrayDeserializer(\n result: Array<StorageDiscoveryScope>,\n): any[] {\n return result.map((item) => {\n return storageDiscoveryScopeDeserializer(item);\n });\n}\n\n/** Storage Discovery Scope. This had added validations */\nexport interface StorageDiscoveryScope {\n /** Display name of the collection */\n displayName: string;\n /** Resource types for the collection */\n resourceTypes: StorageDiscoveryResourceType[];\n /** The storage account tags keys to filter */\n tagKeysOnly?: string[];\n /** Resource tags. */\n tags?: Record<string, string>;\n}\n\nexport function storageDiscoveryScopeSerializer(item: StorageDiscoveryScope): any {\n return {\n displayName: item[\"displayName\"],\n resourceTypes: item[\"resourceTypes\"].map((p: any) => {\n return p;\n }),\n tagKeysOnly: !item[\"tagKeysOnly\"]\n ? item[\"tagKeysOnly\"]\n : item[\"tagKeysOnly\"].map((p: any) => {\n return p;\n }),\n tags: item[\"tags\"],\n };\n}\n\nexport function storageDiscoveryScopeDeserializer(item: any): StorageDiscoveryScope {\n return {\n displayName: item[\"displayName\"],\n resourceTypes: item[\"resourceTypes\"].map((p: any) => {\n return p;\n }),\n tagKeysOnly: !item[\"tagKeysOnly\"]\n ? item[\"tagKeysOnly\"]\n : item[\"tagKeysOnly\"].map((p: any) => {\n return p;\n }),\n tags: item[\"tags\"],\n };\n}\n\n/** Storage Discovery Resource Type */\nexport enum KnownStorageDiscoveryResourceType {\n /** Storage Account Resource Type */\n StorageAccounts = \"Microsoft.Storage/storageAccounts\",\n}\n\n/**\n * Storage Discovery Resource Type \\\n * {@link KnownStorageDiscoveryResourceType} can be used interchangeably with StorageDiscoveryResourceType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Microsoft.Storage\\/storageAccounts**: Storage Account Resource Type\n */\nexport type StorageDiscoveryResourceType = string;\n\n/** The provisioning state of a resource type. */\nexport enum KnownResourceProvisioningState {\n /** Resource has been created. */\n Succeeded = \"Succeeded\",\n /** Resource creation failed. */\n Failed = \"Failed\",\n /** Resource creation was canceled. */\n Canceled = \"Canceled\",\n}\n\n/**\n * The provisioning state of a resource type. \\\n * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded**: Resource has been created. \\\n * **Failed**: Resource creation failed. \\\n * **Canceled**: Resource creation was canceled.\n */\nexport type ResourceProvisioningState = string;\n\n/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */\nexport interface TrackedResource extends Resource {\n /** Resource tags. */\n tags?: Record<string, string>;\n /** The geo-location where the resource lives */\n location: string;\n}\n\nexport function trackedResourceSerializer(item: TrackedResource): any {\n return { tags: item[\"tags\"], location: item[\"location\"] };\n}\n\nexport function trackedResourceDeserializer(item: any): TrackedResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n tags: item[\"tags\"],\n location: item[\"location\"],\n };\n}\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(item: Resource): any {\n return item;\n}\n\nexport function resourceDeserializer(item: any): Resource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\nexport function systemDataDeserializer(item: any): SystemData {\n return {\n createdBy: item[\"createdBy\"],\n createdByType: item[\"createdByType\"],\n createdAt: !item[\"createdAt\"] ? item[\"createdAt\"] : new Date(item[\"createdAt\"]),\n lastModifiedBy: item[\"lastModifiedBy\"],\n lastModifiedByType: item[\"lastModifiedByType\"],\n lastModifiedAt: !item[\"lastModifiedAt\"]\n ? item[\"lastModifiedAt\"]\n : new Date(item[\"lastModifiedAt\"]),\n };\n}\n\n/** The kind of entity that created the resource. */\nexport enum KnownCreatedByType {\n /** The entity was created by a user. */\n User = \"User\",\n /** The entity was created by an application. */\n Application = \"Application\",\n /** The entity was created by a managed identity. */\n ManagedIdentity = \"ManagedIdentity\",\n /** The entity was created by a key. */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnownCreatedByType} can be used interchangeably with createdByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User**: The entity was created by a user. \\\n * **Application**: The entity was created by an application. \\\n * **ManagedIdentity**: The entity was created by a managed identity. \\\n * **Key**: The entity was created by a key.\n */\nexport type CreatedByType = string;\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: any;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: item[\"info\"],\n };\n}\n\n/** The template for adding updateable properties. */\nexport interface StorageDiscoveryWorkspaceUpdate {\n /** Resource tags. */\n tags?: Record<string, string>;\n /** The resource-specific properties for this resource. */\n properties?: StorageDiscoveryWorkspacePropertiesUpdate;\n}\n\nexport function storageDiscoveryWorkspaceUpdateSerializer(\n item: StorageDiscoveryWorkspaceUpdate,\n): any {\n return {\n tags: item[\"tags\"],\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : storageDiscoveryWorkspacePropertiesUpdateSerializer(item[\"properties\"]),\n };\n}\n\n/** The template for adding updateable properties. */\nexport interface StorageDiscoveryWorkspacePropertiesUpdate {\n /** The storage discovery sku */\n sku?: StorageDiscoverySku;\n /** The description of the storage discovery workspace */\n description?: string;\n /** The view level storage discovery data estate */\n workspaceRoots?: string[];\n /** The scopes of the storage discovery workspace. */\n scopes?: StorageDiscoveryScope[];\n}\n\nexport function storageDiscoveryWorkspacePropertiesUpdateSerializer(\n item: StorageDiscoveryWorkspacePropertiesUpdate,\n): any {\n return {\n sku: item[\"sku\"],\n description: item[\"description\"],\n workspaceRoots: !item[\"workspaceRoots\"]\n ? item[\"workspaceRoots\"]\n : item[\"workspaceRoots\"].map((p: any) => {\n return p;\n }),\n scopes: !item[\"scopes\"] ? item[\"scopes\"] : storageDiscoveryScopeArraySerializer(item[\"scopes\"]),\n };\n}\n\n/** The response of a StorageDiscoveryWorkspace list operation. */\nexport interface _StorageDiscoveryWorkspaceListResult {\n /** The StorageDiscoveryWorkspace items on this page */\n value: StorageDiscoveryWorkspace[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _storageDiscoveryWorkspaceListResultDeserializer(\n item: any,\n): _StorageDiscoveryWorkspaceListResult {\n return {\n value: storageDiscoveryWorkspaceArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function storageDiscoveryWorkspaceArraySerializer(\n result: Array<StorageDiscoveryWorkspace>,\n): any[] {\n return result.map((item) => {\n return storageDiscoveryWorkspaceSerializer(item);\n });\n}\n\nexport function storageDiscoveryWorkspaceArrayDeserializer(\n result: Array<StorageDiscoveryWorkspace>,\n): any[] {\n return result.map((item) => {\n return storageDiscoveryWorkspaceDeserializer(item);\n });\n}\n\n/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */\nexport interface _OperationListResult {\n /** The Operation items on this page */\n value: Operation[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _operationListResultDeserializer(item: any): _OperationListResult {\n return {\n value: operationArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function operationArrayDeserializer(result: Array<Operation>): any[] {\n return result.map((item) => {\n return operationDeserializer(item);\n });\n}\n\n/** Details of a REST API operation, returned from the Resource Provider Operations API */\nexport interface Operation {\n /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\" */\n readonly name?: string;\n /** Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations. */\n readonly isDataAction?: boolean;\n /** Localized display information for this particular operation. */\n display?: OperationDisplay;\n /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" */\n readonly origin?: Origin;\n /** Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. */\n readonly actionType?: ActionType;\n}\n\nexport function operationDeserializer(item: any): Operation {\n return {\n name: item[\"name\"],\n isDataAction: item[\"isDataAction\"],\n display: !item[\"display\"] ? item[\"display\"] : operationDisplayDeserializer(item[\"display\"]),\n origin: item[\"origin\"],\n actionType: item[\"actionType\"],\n };\n}\n\n/** Localized display information for and operation. */\nexport interface OperationDisplay {\n /** The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\". */\n readonly provider?: string;\n /** The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\". */\n readonly resource?: string;\n /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\". */\n readonly operation?: string;\n /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */\n readonly description?: string;\n}\n\nexport function operationDisplayDeserializer(item: any): OperationDisplay {\n return {\n provider: item[\"provider\"],\n resource: item[\"resource\"],\n operation: item[\"operation\"],\n description: item[\"description\"],\n };\n}\n\n/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" */\nexport enum KnownOrigin {\n /** Indicates the operation is initiated by a user. */\n User = \"user\",\n /** Indicates the operation is initiated by a system. */\n System = \"system\",\n /** Indicates the operation is initiated by a user or system. */\n UserSystem = \"user,system\",\n}\n\n/**\n * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" \\\n * {@link KnownOrigin} can be used interchangeably with Origin,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **user**: Indicates the operation is initiated by a user. \\\n * **system**: Indicates the operation is initiated by a system. \\\n * **user,system**: Indicates the operation is initiated by a user or system.\n */\nexport type Origin = string;\n\n/** Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. */\nexport enum KnownActionType {\n /** Actions are for internal-only APIs. */\n Internal = \"Internal\",\n}\n\n/**\n * Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \\\n * {@link KnownActionType} can be used interchangeably with ActionType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Internal**: Actions are for internal-only APIs.\n */\nexport type ActionType = string;\n\n/** Known values of {@link ApiVersion} that the service accepts. */\nexport enum KnownApiVersion {\n V20250601Preview = \"2025-06-01-preview\",\n}\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the byPage method
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* A reference to a specific page to start iterating from.
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that describes a page of results.
|
|
13
|
+
*/
|
|
14
|
+
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
15
|
+
/**
|
|
16
|
+
* The token that keeps track of where to continue the iterator
|
|
17
|
+
*/
|
|
18
|
+
continuationToken?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
22
|
+
*/
|
|
23
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
24
|
+
/**
|
|
25
|
+
* The next method, part of the iteration protocol
|
|
26
|
+
*/
|
|
27
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
30
|
+
*/
|
|
31
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
34
|
+
*/
|
|
35
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An interface that describes how to communicate with the service.
|
|
39
|
+
*/
|
|
40
|
+
export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
41
|
+
/**
|
|
42
|
+
* Link to the first page of results.
|
|
43
|
+
*/
|
|
44
|
+
firstPageLink?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A method that returns a page of results.
|
|
47
|
+
*/
|
|
48
|
+
getPage: (pageLink?: string) => Promise<{
|
|
49
|
+
page: TPage;
|
|
50
|
+
nextPageLink?: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* a function to implement the `byPage` method on the paged async iterator.
|
|
54
|
+
*/
|
|
55
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
56
|
+
/**
|
|
57
|
+
* A function to extract elements from a page.
|
|
58
|
+
*/
|
|
59
|
+
toElements?: (page: TPage) => TElement[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the paging helper
|
|
63
|
+
*/
|
|
64
|
+
export interface BuildPagedAsyncIteratorOptions {
|
|
65
|
+
itemName?: string;
|
|
66
|
+
nextLinkName?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
72
|
+
//# sourceMappingURL=pagingHelpers.d.ts.map
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
4
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
import { RestError } from "@azure/core-rest-pipeline";
|
|
6
|
+
/**
|
|
7
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
8
|
+
*/
|
|
9
|
+
export function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const itemName = (_a = options.itemName) !== null && _a !== void 0 ? _a : "value";
|
|
12
|
+
const nextLinkName = (_b = options.nextLinkName) !== null && _b !== void 0 ? _b : "nextLink";
|
|
13
|
+
const pagedResult = {
|
|
14
|
+
getPage: async (pageLink) => {
|
|
15
|
+
const result = pageLink === undefined
|
|
16
|
+
? await getInitialResponse()
|
|
17
|
+
: await client.pathUnchecked(pageLink).get();
|
|
18
|
+
checkPagingRequest(result, expectedStatuses);
|
|
19
|
+
const results = await processResponseBody(result);
|
|
20
|
+
const nextLink = getNextLink(results, nextLinkName);
|
|
21
|
+
const values = getElements(results, itemName);
|
|
22
|
+
return {
|
|
23
|
+
page: values,
|
|
24
|
+
nextPageLink: nextLink,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
byPage: (settings) => {
|
|
28
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
29
|
+
return getPageAsyncIterator(pagedResult, {
|
|
30
|
+
pageLink: continuationToken,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
return getPagedAsyncIterator(pagedResult);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
38
|
+
* method that returns pages of items at once.
|
|
39
|
+
*
|
|
40
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
41
|
+
* @returns a paged async iterator that iterates over results.
|
|
42
|
+
*/
|
|
43
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
44
|
+
var _a;
|
|
45
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
},
|
|
53
|
+
byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
|
|
54
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
55
|
+
return getPageAsyncIterator(pagedResult, {
|
|
56
|
+
pageLink: continuationToken,
|
|
57
|
+
});
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function getItemAsyncIterator(pagedResult) {
|
|
62
|
+
return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
|
|
63
|
+
var _a, e_1, _b, _c;
|
|
64
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
65
|
+
try {
|
|
66
|
+
for (var _d = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _d = true) {
|
|
67
|
+
_c = pages_1_1.value;
|
|
68
|
+
_d = false;
|
|
69
|
+
const page = _c;
|
|
70
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
|
+
finally {
|
|
75
|
+
try {
|
|
76
|
+
if (!_d && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
|
|
77
|
+
}
|
|
78
|
+
finally { if (e_1) throw e_1.error; }
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function getPageAsyncIterator(pagedResult_1) {
|
|
83
|
+
return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
|
|
84
|
+
const { pageLink } = options;
|
|
85
|
+
let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
|
|
86
|
+
if (!response) {
|
|
87
|
+
return yield __await(void 0);
|
|
88
|
+
}
|
|
89
|
+
let result = response.page;
|
|
90
|
+
result.continuationToken = response.nextPageLink;
|
|
91
|
+
yield yield __await(result);
|
|
92
|
+
while (response.nextPageLink) {
|
|
93
|
+
response = yield __await(pagedResult.getPage(response.nextPageLink));
|
|
94
|
+
if (!response) {
|
|
95
|
+
return yield __await(void 0);
|
|
96
|
+
}
|
|
97
|
+
result = response.page;
|
|
98
|
+
result.continuationToken = response.nextPageLink;
|
|
99
|
+
yield yield __await(result);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets for the value of nextLink in the body
|
|
105
|
+
*/
|
|
106
|
+
function getNextLink(body, nextLinkName) {
|
|
107
|
+
if (!nextLinkName) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const nextLink = body[nextLinkName];
|
|
111
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
|
|
112
|
+
throw new RestError(`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`);
|
|
113
|
+
}
|
|
114
|
+
if (nextLink === null) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
return nextLink;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the elements of the current request in the body.
|
|
121
|
+
*/
|
|
122
|
+
function getElements(body, itemName) {
|
|
123
|
+
const value = body[itemName];
|
|
124
|
+
if (!Array.isArray(value)) {
|
|
125
|
+
throw new RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
126
|
+
}
|
|
127
|
+
return value !== null && value !== void 0 ? value : [];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Checks if a request failed
|
|
131
|
+
*/
|
|
132
|
+
function checkPagingRequest(response, expectedStatuses) {
|
|
133
|
+
if (!expectedStatuses.includes(response.status)) {
|
|
134
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=pagingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA+EtD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;;IAE5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,MAAM,kBAAkB,EAAE;gBAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;YACjD,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,MAAmB,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACpD,MAAM,MAAM,GAAG,WAAW,CAAW,OAAO,EAAE,QAAQ,CAAU,CAAC;YACjE,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE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,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|