@azure/arm-defendereasm 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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/index.js +2047 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/labelsCreateAndUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/labelsCreateAndUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/labelsCreateAndUpdateSample.js +40 -0
- package/dist-esm/samples-dev/labelsCreateAndUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/labelsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/labelsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/labelsDeleteSample.js +40 -0
- package/dist-esm/samples-dev/labelsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/labelsGetByWorkspaceSample.d.ts +2 -0
- package/dist-esm/samples-dev/labelsGetByWorkspaceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/labelsGetByWorkspaceSample.js +40 -0
- package/dist-esm/samples-dev/labelsGetByWorkspaceSample.js.map +1 -0
- package/dist-esm/samples-dev/labelsListByWorkspaceSample.d.ts +2 -0
- package/dist-esm/samples-dev/labelsListByWorkspaceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/labelsListByWorkspaceSample.js +60 -0
- package/dist-esm/samples-dev/labelsListByWorkspaceSample.js.map +1 -0
- package/dist-esm/samples-dev/labelsUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/labelsUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/labelsUpdateSample.js +40 -0
- package/dist-esm/samples-dev/labelsUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +58 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/tasksGetByWorkspaceSample.d.ts +2 -0
- package/dist-esm/samples-dev/tasksGetByWorkspaceSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/tasksGetByWorkspaceSample.js +40 -0
- package/dist-esm/samples-dev/tasksGetByWorkspaceSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.js +43 -0
- package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesDeleteSample.js +39 -0
- package/dist-esm/samples-dev/workspacesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesGetSample.js +39 -0
- package/dist-esm/samples-dev/workspacesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js +59 -0
- package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js +58 -0
- package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/workspacesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/workspacesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/workspacesUpdateSample.js +39 -0
- package/dist-esm/samples-dev/workspacesUpdateSample.js.map +1 -0
- package/dist-esm/src/easmMgmtClient.d.ts +23 -0
- package/dist-esm/src/easmMgmtClient.d.ts.map +1 -0
- package/dist-esm/src/easmMgmtClient.js +103 -0
- package/dist-esm/src/easmMgmtClient.js.map +1 -0
- package/dist-esm/src/index.d.ts +6 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +11 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +21 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +492 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +66 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +23 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +574 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +16 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +137 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +5 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +12 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/labels.d.ts +87 -0
- package/dist-esm/src/operations/labels.d.ts.map +1 -0
- package/dist-esm/src/operations/labels.js +395 -0
- package/dist-esm/src/operations/labels.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +138 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/tasks.d.ts +21 -0
- package/dist-esm/src/operations/tasks.d.ts.map +1 -0
- package/dist-esm/src/operations/tasks.js +55 -0
- package/dist-esm/src/operations/tasks.js.map +1 -0
- package/dist-esm/src/operations/workspaces.d.ts +96 -0
- package/dist-esm/src/operations/workspaces.d.ts.map +1 -0
- package/dist-esm/src/operations/workspaces.js +496 -0
- package/dist-esm/src/operations/workspaces.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +12 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/labels.d.ts +62 -0
- package/dist-esm/src/operationsInterfaces/labels.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/labels.js +9 -0
- package/dist-esm/src/operationsInterfaces/labels.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/tasks.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/tasks.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/tasks.js +9 -0
- package/dist-esm/src/operationsInterfaces/tasks.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/workspaces.d.ts +60 -0
- package/dist-esm/src/operationsInterfaces/workspaces.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/workspaces.js +9 -0
- package/dist-esm/src/operationsInterfaces/workspaces.js.map +1 -0
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/defendereasm_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/defendereasm_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/defendereasm_operations_test.spec.js +120 -0
- package/dist-esm/test/defendereasm_operations_test.spec.js.map +1 -0
- package/package.json +123 -0
- package/review/arm-defendereasm.api.md +400 -0
- package/rollup.config.js +122 -0
- package/src/easmMgmtClient.ts +151 -0
- package/src/index.ts +13 -0
- package/src/lroImpl.ts +42 -0
- package/src/models/index.ts +562 -0
- package/src/models/mappers.ts +639 -0
- package/src/models/parameters.ts +161 -0
- package/src/operations/index.ts +12 -0
- package/src/operations/labels.ts +543 -0
- package/src/operations/operations.ts +149 -0
- package/src/operations/tasks.ts +75 -0
- package/src/operations/workspaces.ts +625 -0
- package/src/operationsInterfaces/index.ts +12 -0
- package/src/operationsInterfaces/labels.ts +120 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/tasks.ts +29 -0
- package/src/operationsInterfaces/workspaces.ts +114 -0
- package/src/pagingHelper.ts +39 -0
- package/tsconfig.json +33 -0
- package/types/arm-defendereasm.d.ts +724 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
import {
|
|
10
|
+
OperationParameter,
|
|
11
|
+
OperationURLParameter,
|
|
12
|
+
OperationQueryParameter
|
|
13
|
+
} from "@azure/core-client";
|
|
14
|
+
import {
|
|
15
|
+
WorkspaceResource as WorkspaceResourceMapper,
|
|
16
|
+
WorkspacePatchResource as WorkspacePatchResourceMapper,
|
|
17
|
+
LabelResource as LabelResourceMapper,
|
|
18
|
+
LabelPatchResource as LabelPatchResourceMapper
|
|
19
|
+
} from "../models/mappers";
|
|
20
|
+
|
|
21
|
+
export const accept: OperationParameter = {
|
|
22
|
+
parameterPath: "accept",
|
|
23
|
+
mapper: {
|
|
24
|
+
defaultValue: "application/json",
|
|
25
|
+
isConstant: true,
|
|
26
|
+
serializedName: "Accept",
|
|
27
|
+
type: {
|
|
28
|
+
name: "String"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const $host: OperationURLParameter = {
|
|
34
|
+
parameterPath: "$host",
|
|
35
|
+
mapper: {
|
|
36
|
+
serializedName: "$host",
|
|
37
|
+
required: true,
|
|
38
|
+
type: {
|
|
39
|
+
name: "String"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
skipEncoding: true
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const apiVersion: OperationQueryParameter = {
|
|
46
|
+
parameterPath: "apiVersion",
|
|
47
|
+
mapper: {
|
|
48
|
+
defaultValue: "2023-04-01-preview",
|
|
49
|
+
isConstant: true,
|
|
50
|
+
serializedName: "api-version",
|
|
51
|
+
type: {
|
|
52
|
+
name: "String"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const subscriptionId: OperationURLParameter = {
|
|
58
|
+
parameterPath: "subscriptionId",
|
|
59
|
+
mapper: {
|
|
60
|
+
constraints: {
|
|
61
|
+
MinLength: 1
|
|
62
|
+
},
|
|
63
|
+
serializedName: "subscriptionId",
|
|
64
|
+
required: true,
|
|
65
|
+
type: {
|
|
66
|
+
name: "String"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const resourceGroupName: OperationURLParameter = {
|
|
72
|
+
parameterPath: "resourceGroupName",
|
|
73
|
+
mapper: {
|
|
74
|
+
constraints: {
|
|
75
|
+
MaxLength: 90,
|
|
76
|
+
MinLength: 1
|
|
77
|
+
},
|
|
78
|
+
serializedName: "resourceGroupName",
|
|
79
|
+
required: true,
|
|
80
|
+
type: {
|
|
81
|
+
name: "String"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const workspaceName: OperationURLParameter = {
|
|
87
|
+
parameterPath: "workspaceName",
|
|
88
|
+
mapper: {
|
|
89
|
+
serializedName: "workspaceName",
|
|
90
|
+
required: true,
|
|
91
|
+
type: {
|
|
92
|
+
name: "String"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const contentType: OperationParameter = {
|
|
98
|
+
parameterPath: ["options", "contentType"],
|
|
99
|
+
mapper: {
|
|
100
|
+
defaultValue: "application/json",
|
|
101
|
+
isConstant: true,
|
|
102
|
+
serializedName: "Content-Type",
|
|
103
|
+
type: {
|
|
104
|
+
name: "String"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const workspaceResource: OperationParameter = {
|
|
110
|
+
parameterPath: ["options", "workspaceResource"],
|
|
111
|
+
mapper: WorkspaceResourceMapper
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const workspacePatchResource: OperationParameter = {
|
|
115
|
+
parameterPath: ["options", "workspacePatchResource"],
|
|
116
|
+
mapper: WorkspacePatchResourceMapper
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const nextLink: OperationURLParameter = {
|
|
120
|
+
parameterPath: "nextLink",
|
|
121
|
+
mapper: {
|
|
122
|
+
serializedName: "nextLink",
|
|
123
|
+
required: true,
|
|
124
|
+
type: {
|
|
125
|
+
name: "String"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
skipEncoding: true
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const labelName: OperationURLParameter = {
|
|
132
|
+
parameterPath: "labelName",
|
|
133
|
+
mapper: {
|
|
134
|
+
serializedName: "labelName",
|
|
135
|
+
required: true,
|
|
136
|
+
type: {
|
|
137
|
+
name: "String"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const labelResource: OperationParameter = {
|
|
143
|
+
parameterPath: ["options", "labelResource"],
|
|
144
|
+
mapper: LabelResourceMapper
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const labelPatchResource: OperationParameter = {
|
|
148
|
+
parameterPath: ["options", "labelPatchResource"],
|
|
149
|
+
mapper: LabelPatchResourceMapper
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const taskId: OperationURLParameter = {
|
|
153
|
+
parameterPath: "taskId",
|
|
154
|
+
mapper: {
|
|
155
|
+
serializedName: "taskId",
|
|
156
|
+
required: true,
|
|
157
|
+
type: {
|
|
158
|
+
name: "String"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 * from "./workspaces";
|
|
10
|
+
export * from "./labels";
|
|
11
|
+
export * from "./tasks";
|
|
12
|
+
export * from "./operations";
|
|
@@ -0,0 +1,543 @@
|
|
|
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
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
11
|
+
import { Labels } from "../operationsInterfaces";
|
|
12
|
+
import * as coreClient from "@azure/core-client";
|
|
13
|
+
import * as Mappers from "../models/mappers";
|
|
14
|
+
import * as Parameters from "../models/parameters";
|
|
15
|
+
import { EasmMgmtClient } from "../easmMgmtClient";
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
22
|
+
import {
|
|
23
|
+
LabelResource,
|
|
24
|
+
LabelsListByWorkspaceNextOptionalParams,
|
|
25
|
+
LabelsListByWorkspaceOptionalParams,
|
|
26
|
+
LabelsListByWorkspaceResponse,
|
|
27
|
+
LabelsGetByWorkspaceOptionalParams,
|
|
28
|
+
LabelsGetByWorkspaceResponse,
|
|
29
|
+
LabelsCreateAndUpdateOptionalParams,
|
|
30
|
+
LabelsCreateAndUpdateResponse,
|
|
31
|
+
LabelsUpdateOptionalParams,
|
|
32
|
+
LabelsUpdateResponse,
|
|
33
|
+
LabelsDeleteOptionalParams,
|
|
34
|
+
LabelsListByWorkspaceNextResponse
|
|
35
|
+
} from "../models";
|
|
36
|
+
|
|
37
|
+
/// <reference lib="esnext.asynciterable" />
|
|
38
|
+
/** Class containing Labels operations. */
|
|
39
|
+
export class LabelsImpl implements Labels {
|
|
40
|
+
private readonly client: EasmMgmtClient;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initialize a new instance of the class Labels class.
|
|
44
|
+
* @param client Reference to the service client
|
|
45
|
+
*/
|
|
46
|
+
constructor(client: EasmMgmtClient) {
|
|
47
|
+
this.client = client;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns a list of labels in the given workspace.
|
|
52
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
53
|
+
* @param workspaceName The name of the Workspace.
|
|
54
|
+
* @param options The options parameters.
|
|
55
|
+
*/
|
|
56
|
+
public listByWorkspace(
|
|
57
|
+
resourceGroupName: string,
|
|
58
|
+
workspaceName: string,
|
|
59
|
+
options?: LabelsListByWorkspaceOptionalParams
|
|
60
|
+
): PagedAsyncIterableIterator<LabelResource> {
|
|
61
|
+
const iter = this.listByWorkspacePagingAll(
|
|
62
|
+
resourceGroupName,
|
|
63
|
+
workspaceName,
|
|
64
|
+
options
|
|
65
|
+
);
|
|
66
|
+
return {
|
|
67
|
+
next() {
|
|
68
|
+
return iter.next();
|
|
69
|
+
},
|
|
70
|
+
[Symbol.asyncIterator]() {
|
|
71
|
+
return this;
|
|
72
|
+
},
|
|
73
|
+
byPage: (settings?: PageSettings) => {
|
|
74
|
+
if (settings?.maxPageSize) {
|
|
75
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
76
|
+
}
|
|
77
|
+
return this.listByWorkspacePagingPage(
|
|
78
|
+
resourceGroupName,
|
|
79
|
+
workspaceName,
|
|
80
|
+
options,
|
|
81
|
+
settings
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private async *listByWorkspacePagingPage(
|
|
88
|
+
resourceGroupName: string,
|
|
89
|
+
workspaceName: string,
|
|
90
|
+
options?: LabelsListByWorkspaceOptionalParams,
|
|
91
|
+
settings?: PageSettings
|
|
92
|
+
): AsyncIterableIterator<LabelResource[]> {
|
|
93
|
+
let result: LabelsListByWorkspaceResponse;
|
|
94
|
+
let continuationToken = settings?.continuationToken;
|
|
95
|
+
if (!continuationToken) {
|
|
96
|
+
result = await this._listByWorkspace(
|
|
97
|
+
resourceGroupName,
|
|
98
|
+
workspaceName,
|
|
99
|
+
options
|
|
100
|
+
);
|
|
101
|
+
let page = result.value || [];
|
|
102
|
+
continuationToken = result.nextLink;
|
|
103
|
+
setContinuationToken(page, continuationToken);
|
|
104
|
+
yield page;
|
|
105
|
+
}
|
|
106
|
+
while (continuationToken) {
|
|
107
|
+
result = await this._listByWorkspaceNext(
|
|
108
|
+
resourceGroupName,
|
|
109
|
+
workspaceName,
|
|
110
|
+
continuationToken,
|
|
111
|
+
options
|
|
112
|
+
);
|
|
113
|
+
continuationToken = result.nextLink;
|
|
114
|
+
let page = result.value || [];
|
|
115
|
+
setContinuationToken(page, continuationToken);
|
|
116
|
+
yield page;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private async *listByWorkspacePagingAll(
|
|
121
|
+
resourceGroupName: string,
|
|
122
|
+
workspaceName: string,
|
|
123
|
+
options?: LabelsListByWorkspaceOptionalParams
|
|
124
|
+
): AsyncIterableIterator<LabelResource> {
|
|
125
|
+
for await (const page of this.listByWorkspacePagingPage(
|
|
126
|
+
resourceGroupName,
|
|
127
|
+
workspaceName,
|
|
128
|
+
options
|
|
129
|
+
)) {
|
|
130
|
+
yield* page;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Returns a list of labels in the given workspace.
|
|
136
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
137
|
+
* @param workspaceName The name of the Workspace.
|
|
138
|
+
* @param options The options parameters.
|
|
139
|
+
*/
|
|
140
|
+
private _listByWorkspace(
|
|
141
|
+
resourceGroupName: string,
|
|
142
|
+
workspaceName: string,
|
|
143
|
+
options?: LabelsListByWorkspaceOptionalParams
|
|
144
|
+
): Promise<LabelsListByWorkspaceResponse> {
|
|
145
|
+
return this.client.sendOperationRequest(
|
|
146
|
+
{ resourceGroupName, workspaceName, options },
|
|
147
|
+
listByWorkspaceOperationSpec
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns a label in the given workspace.
|
|
153
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
154
|
+
* @param workspaceName The name of the Workspace.
|
|
155
|
+
* @param labelName The name of the Label.
|
|
156
|
+
* @param options The options parameters.
|
|
157
|
+
*/
|
|
158
|
+
getByWorkspace(
|
|
159
|
+
resourceGroupName: string,
|
|
160
|
+
workspaceName: string,
|
|
161
|
+
labelName: string,
|
|
162
|
+
options?: LabelsGetByWorkspaceOptionalParams
|
|
163
|
+
): Promise<LabelsGetByWorkspaceResponse> {
|
|
164
|
+
return this.client.sendOperationRequest(
|
|
165
|
+
{ resourceGroupName, workspaceName, labelName, options },
|
|
166
|
+
getByWorkspaceOperationSpec
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Create or update a Label.
|
|
172
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
173
|
+
* @param workspaceName The name of the Workspace.
|
|
174
|
+
* @param labelName The name of the Label.
|
|
175
|
+
* @param options The options parameters.
|
|
176
|
+
*/
|
|
177
|
+
async beginCreateAndUpdate(
|
|
178
|
+
resourceGroupName: string,
|
|
179
|
+
workspaceName: string,
|
|
180
|
+
labelName: string,
|
|
181
|
+
options?: LabelsCreateAndUpdateOptionalParams
|
|
182
|
+
): Promise<
|
|
183
|
+
SimplePollerLike<
|
|
184
|
+
OperationState<LabelsCreateAndUpdateResponse>,
|
|
185
|
+
LabelsCreateAndUpdateResponse
|
|
186
|
+
>
|
|
187
|
+
> {
|
|
188
|
+
const directSendOperation = async (
|
|
189
|
+
args: coreClient.OperationArguments,
|
|
190
|
+
spec: coreClient.OperationSpec
|
|
191
|
+
): Promise<LabelsCreateAndUpdateResponse> => {
|
|
192
|
+
return this.client.sendOperationRequest(args, spec);
|
|
193
|
+
};
|
|
194
|
+
const sendOperationFn = async (
|
|
195
|
+
args: coreClient.OperationArguments,
|
|
196
|
+
spec: coreClient.OperationSpec
|
|
197
|
+
) => {
|
|
198
|
+
let currentRawResponse:
|
|
199
|
+
| coreClient.FullOperationResponse
|
|
200
|
+
| undefined = undefined;
|
|
201
|
+
const providedCallback = args.options?.onResponse;
|
|
202
|
+
const callback: coreClient.RawResponseCallback = (
|
|
203
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
204
|
+
flatResponse: unknown
|
|
205
|
+
) => {
|
|
206
|
+
currentRawResponse = rawResponse;
|
|
207
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
208
|
+
};
|
|
209
|
+
const updatedArgs = {
|
|
210
|
+
...args,
|
|
211
|
+
options: {
|
|
212
|
+
...args.options,
|
|
213
|
+
onResponse: callback
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
217
|
+
return {
|
|
218
|
+
flatResponse,
|
|
219
|
+
rawResponse: {
|
|
220
|
+
statusCode: currentRawResponse!.status,
|
|
221
|
+
body: currentRawResponse!.parsedBody,
|
|
222
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const lro = createLroSpec({
|
|
228
|
+
sendOperationFn,
|
|
229
|
+
args: { resourceGroupName, workspaceName, labelName, options },
|
|
230
|
+
spec: createAndUpdateOperationSpec
|
|
231
|
+
});
|
|
232
|
+
const poller = await createHttpPoller<
|
|
233
|
+
LabelsCreateAndUpdateResponse,
|
|
234
|
+
OperationState<LabelsCreateAndUpdateResponse>
|
|
235
|
+
>(lro, {
|
|
236
|
+
restoreFrom: options?.resumeFrom,
|
|
237
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
238
|
+
resourceLocationConfig: "azure-async-operation"
|
|
239
|
+
});
|
|
240
|
+
await poller.poll();
|
|
241
|
+
return poller;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Create or update a Label.
|
|
246
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
247
|
+
* @param workspaceName The name of the Workspace.
|
|
248
|
+
* @param labelName The name of the Label.
|
|
249
|
+
* @param options The options parameters.
|
|
250
|
+
*/
|
|
251
|
+
async beginCreateAndUpdateAndWait(
|
|
252
|
+
resourceGroupName: string,
|
|
253
|
+
workspaceName: string,
|
|
254
|
+
labelName: string,
|
|
255
|
+
options?: LabelsCreateAndUpdateOptionalParams
|
|
256
|
+
): Promise<LabelsCreateAndUpdateResponse> {
|
|
257
|
+
const poller = await this.beginCreateAndUpdate(
|
|
258
|
+
resourceGroupName,
|
|
259
|
+
workspaceName,
|
|
260
|
+
labelName,
|
|
261
|
+
options
|
|
262
|
+
);
|
|
263
|
+
return poller.pollUntilDone();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Update a Label.
|
|
268
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
269
|
+
* @param workspaceName The name of the Workspace.
|
|
270
|
+
* @param labelName The name of the Label.
|
|
271
|
+
* @param options The options parameters.
|
|
272
|
+
*/
|
|
273
|
+
update(
|
|
274
|
+
resourceGroupName: string,
|
|
275
|
+
workspaceName: string,
|
|
276
|
+
labelName: string,
|
|
277
|
+
options?: LabelsUpdateOptionalParams
|
|
278
|
+
): Promise<LabelsUpdateResponse> {
|
|
279
|
+
return this.client.sendOperationRequest(
|
|
280
|
+
{ resourceGroupName, workspaceName, labelName, options },
|
|
281
|
+
updateOperationSpec
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Delete a Label.
|
|
287
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
288
|
+
* @param workspaceName The name of the Workspace.
|
|
289
|
+
* @param labelName The name of the Label.
|
|
290
|
+
* @param options The options parameters.
|
|
291
|
+
*/
|
|
292
|
+
async beginDelete(
|
|
293
|
+
resourceGroupName: string,
|
|
294
|
+
workspaceName: string,
|
|
295
|
+
labelName: string,
|
|
296
|
+
options?: LabelsDeleteOptionalParams
|
|
297
|
+
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
|
298
|
+
const directSendOperation = async (
|
|
299
|
+
args: coreClient.OperationArguments,
|
|
300
|
+
spec: coreClient.OperationSpec
|
|
301
|
+
): Promise<void> => {
|
|
302
|
+
return this.client.sendOperationRequest(args, spec);
|
|
303
|
+
};
|
|
304
|
+
const sendOperationFn = async (
|
|
305
|
+
args: coreClient.OperationArguments,
|
|
306
|
+
spec: coreClient.OperationSpec
|
|
307
|
+
) => {
|
|
308
|
+
let currentRawResponse:
|
|
309
|
+
| coreClient.FullOperationResponse
|
|
310
|
+
| undefined = undefined;
|
|
311
|
+
const providedCallback = args.options?.onResponse;
|
|
312
|
+
const callback: coreClient.RawResponseCallback = (
|
|
313
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
314
|
+
flatResponse: unknown
|
|
315
|
+
) => {
|
|
316
|
+
currentRawResponse = rawResponse;
|
|
317
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
318
|
+
};
|
|
319
|
+
const updatedArgs = {
|
|
320
|
+
...args,
|
|
321
|
+
options: {
|
|
322
|
+
...args.options,
|
|
323
|
+
onResponse: callback
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
327
|
+
return {
|
|
328
|
+
flatResponse,
|
|
329
|
+
rawResponse: {
|
|
330
|
+
statusCode: currentRawResponse!.status,
|
|
331
|
+
body: currentRawResponse!.parsedBody,
|
|
332
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const lro = createLroSpec({
|
|
338
|
+
sendOperationFn,
|
|
339
|
+
args: { resourceGroupName, workspaceName, labelName, options },
|
|
340
|
+
spec: deleteOperationSpec
|
|
341
|
+
});
|
|
342
|
+
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
|
343
|
+
restoreFrom: options?.resumeFrom,
|
|
344
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
345
|
+
resourceLocationConfig: "azure-async-operation"
|
|
346
|
+
});
|
|
347
|
+
await poller.poll();
|
|
348
|
+
return poller;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Delete a Label.
|
|
353
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
354
|
+
* @param workspaceName The name of the Workspace.
|
|
355
|
+
* @param labelName The name of the Label.
|
|
356
|
+
* @param options The options parameters.
|
|
357
|
+
*/
|
|
358
|
+
async beginDeleteAndWait(
|
|
359
|
+
resourceGroupName: string,
|
|
360
|
+
workspaceName: string,
|
|
361
|
+
labelName: string,
|
|
362
|
+
options?: LabelsDeleteOptionalParams
|
|
363
|
+
): Promise<void> {
|
|
364
|
+
const poller = await this.beginDelete(
|
|
365
|
+
resourceGroupName,
|
|
366
|
+
workspaceName,
|
|
367
|
+
labelName,
|
|
368
|
+
options
|
|
369
|
+
);
|
|
370
|
+
return poller.pollUntilDone();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* ListByWorkspaceNext
|
|
375
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
376
|
+
* @param workspaceName The name of the Workspace.
|
|
377
|
+
* @param nextLink The nextLink from the previous successful call to the ListByWorkspace method.
|
|
378
|
+
* @param options The options parameters.
|
|
379
|
+
*/
|
|
380
|
+
private _listByWorkspaceNext(
|
|
381
|
+
resourceGroupName: string,
|
|
382
|
+
workspaceName: string,
|
|
383
|
+
nextLink: string,
|
|
384
|
+
options?: LabelsListByWorkspaceNextOptionalParams
|
|
385
|
+
): Promise<LabelsListByWorkspaceNextResponse> {
|
|
386
|
+
return this.client.sendOperationRequest(
|
|
387
|
+
{ resourceGroupName, workspaceName, nextLink, options },
|
|
388
|
+
listByWorkspaceNextOperationSpec
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
// Operation Specifications
|
|
393
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
394
|
+
|
|
395
|
+
const listByWorkspaceOperationSpec: coreClient.OperationSpec = {
|
|
396
|
+
path:
|
|
397
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels",
|
|
398
|
+
httpMethod: "GET",
|
|
399
|
+
responses: {
|
|
400
|
+
200: {
|
|
401
|
+
bodyMapper: Mappers.LabelResourceList
|
|
402
|
+
},
|
|
403
|
+
default: {
|
|
404
|
+
bodyMapper: Mappers.ErrorResponse
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
queryParameters: [Parameters.apiVersion],
|
|
408
|
+
urlParameters: [
|
|
409
|
+
Parameters.$host,
|
|
410
|
+
Parameters.subscriptionId,
|
|
411
|
+
Parameters.resourceGroupName,
|
|
412
|
+
Parameters.workspaceName
|
|
413
|
+
],
|
|
414
|
+
headerParameters: [Parameters.accept],
|
|
415
|
+
serializer
|
|
416
|
+
};
|
|
417
|
+
const getByWorkspaceOperationSpec: coreClient.OperationSpec = {
|
|
418
|
+
path:
|
|
419
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
|
|
420
|
+
httpMethod: "GET",
|
|
421
|
+
responses: {
|
|
422
|
+
200: {
|
|
423
|
+
bodyMapper: Mappers.LabelResource
|
|
424
|
+
},
|
|
425
|
+
default: {
|
|
426
|
+
bodyMapper: Mappers.ErrorResponse
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
queryParameters: [Parameters.apiVersion],
|
|
430
|
+
urlParameters: [
|
|
431
|
+
Parameters.$host,
|
|
432
|
+
Parameters.subscriptionId,
|
|
433
|
+
Parameters.resourceGroupName,
|
|
434
|
+
Parameters.workspaceName,
|
|
435
|
+
Parameters.labelName
|
|
436
|
+
],
|
|
437
|
+
headerParameters: [Parameters.accept],
|
|
438
|
+
serializer
|
|
439
|
+
};
|
|
440
|
+
const createAndUpdateOperationSpec: coreClient.OperationSpec = {
|
|
441
|
+
path:
|
|
442
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
|
|
443
|
+
httpMethod: "PUT",
|
|
444
|
+
responses: {
|
|
445
|
+
200: {
|
|
446
|
+
bodyMapper: Mappers.LabelResource
|
|
447
|
+
},
|
|
448
|
+
201: {
|
|
449
|
+
bodyMapper: Mappers.LabelResource
|
|
450
|
+
},
|
|
451
|
+
202: {
|
|
452
|
+
bodyMapper: Mappers.LabelResource
|
|
453
|
+
},
|
|
454
|
+
204: {
|
|
455
|
+
bodyMapper: Mappers.LabelResource
|
|
456
|
+
},
|
|
457
|
+
default: {
|
|
458
|
+
bodyMapper: Mappers.ErrorResponse
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
requestBody: Parameters.labelResource,
|
|
462
|
+
queryParameters: [Parameters.apiVersion],
|
|
463
|
+
urlParameters: [
|
|
464
|
+
Parameters.$host,
|
|
465
|
+
Parameters.subscriptionId,
|
|
466
|
+
Parameters.resourceGroupName,
|
|
467
|
+
Parameters.workspaceName,
|
|
468
|
+
Parameters.labelName
|
|
469
|
+
],
|
|
470
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
471
|
+
mediaType: "json",
|
|
472
|
+
serializer
|
|
473
|
+
};
|
|
474
|
+
const updateOperationSpec: coreClient.OperationSpec = {
|
|
475
|
+
path:
|
|
476
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
|
|
477
|
+
httpMethod: "PATCH",
|
|
478
|
+
responses: {
|
|
479
|
+
200: {
|
|
480
|
+
bodyMapper: Mappers.LabelResource
|
|
481
|
+
},
|
|
482
|
+
default: {
|
|
483
|
+
bodyMapper: Mappers.ErrorResponse
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
requestBody: Parameters.labelPatchResource,
|
|
487
|
+
queryParameters: [Parameters.apiVersion],
|
|
488
|
+
urlParameters: [
|
|
489
|
+
Parameters.$host,
|
|
490
|
+
Parameters.subscriptionId,
|
|
491
|
+
Parameters.resourceGroupName,
|
|
492
|
+
Parameters.workspaceName,
|
|
493
|
+
Parameters.labelName
|
|
494
|
+
],
|
|
495
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
496
|
+
mediaType: "json",
|
|
497
|
+
serializer
|
|
498
|
+
};
|
|
499
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
500
|
+
path:
|
|
501
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
|
|
502
|
+
httpMethod: "DELETE",
|
|
503
|
+
responses: {
|
|
504
|
+
200: {},
|
|
505
|
+
201: {},
|
|
506
|
+
202: {},
|
|
507
|
+
204: {},
|
|
508
|
+
default: {
|
|
509
|
+
bodyMapper: Mappers.ErrorResponse
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
queryParameters: [Parameters.apiVersion],
|
|
513
|
+
urlParameters: [
|
|
514
|
+
Parameters.$host,
|
|
515
|
+
Parameters.subscriptionId,
|
|
516
|
+
Parameters.resourceGroupName,
|
|
517
|
+
Parameters.workspaceName,
|
|
518
|
+
Parameters.labelName
|
|
519
|
+
],
|
|
520
|
+
headerParameters: [Parameters.accept],
|
|
521
|
+
serializer
|
|
522
|
+
};
|
|
523
|
+
const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = {
|
|
524
|
+
path: "{nextLink}",
|
|
525
|
+
httpMethod: "GET",
|
|
526
|
+
responses: {
|
|
527
|
+
200: {
|
|
528
|
+
bodyMapper: Mappers.LabelResourceList
|
|
529
|
+
},
|
|
530
|
+
default: {
|
|
531
|
+
bodyMapper: Mappers.ErrorResponse
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
urlParameters: [
|
|
535
|
+
Parameters.$host,
|
|
536
|
+
Parameters.subscriptionId,
|
|
537
|
+
Parameters.resourceGroupName,
|
|
538
|
+
Parameters.workspaceName,
|
|
539
|
+
Parameters.nextLink
|
|
540
|
+
],
|
|
541
|
+
headerParameters: [Parameters.accept],
|
|
542
|
+
serializer
|
|
543
|
+
};
|