@azure/arm-appcomplianceautomation 1.0.0-alpha.20221102.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 +2463 -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/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +42 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/samples-dev/reportCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/reportCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/reportCreateOrUpdateSample.js +42 -0
- package/dist-esm/samples-dev/reportCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/reportDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/reportDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/reportDeleteSample.js +29 -0
- package/dist-esm/samples-dev/reportDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/reportGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/reportGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/reportGetSample.js +29 -0
- package/dist-esm/samples-dev/reportGetSample.js.map +1 -0
- package/dist-esm/samples-dev/reportUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/reportUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/reportUpdateSample.js +42 -0
- package/dist-esm/samples-dev/reportUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/reportsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/reportsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/reportsListSample.js +52 -0
- package/dist-esm/samples-dev/reportsListSample.js.map +1 -0
- package/dist-esm/samples-dev/snapshotDownloadSample.d.ts +2 -0
- package/dist-esm/samples-dev/snapshotDownloadSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/snapshotDownloadSample.js +101 -0
- package/dist-esm/samples-dev/snapshotDownloadSample.js.map +1 -0
- package/dist-esm/samples-dev/snapshotGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/snapshotGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/snapshotGetSample.js +30 -0
- package/dist-esm/samples-dev/snapshotGetSample.js.map +1 -0
- package/dist-esm/samples-dev/snapshotsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/snapshotsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/snapshotsListSample.js +53 -0
- package/dist-esm/samples-dev/snapshotsListSample.js.map +1 -0
- package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.d.ts +22 -0
- package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.d.ts.map +1 -0
- package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js +101 -0
- package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +1046 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +166 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +33 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +1167 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +17 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +157 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +6 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +13 -0
- package/dist-esm/src/operations/index.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 +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/report.d.ts +60 -0
- package/dist-esm/src/operations/report.d.ts.map +1 -0
- package/dist-esm/src/operations/report.js +275 -0
- package/dist-esm/src/operations/report.js.map +1 -0
- package/dist-esm/src/operations/reports.d.ts +32 -0
- package/dist-esm/src/operations/reports.d.ts.map +1 -0
- package/dist-esm/src/operations/reports.js +134 -0
- package/dist-esm/src/operations/reports.js.map +1 -0
- package/dist-esm/src/operations/snapshot.d.ts +37 -0
- package/dist-esm/src/operations/snapshot.d.ts.map +1 -0
- package/dist-esm/src/operations/snapshot.js +140 -0
- package/dist-esm/src/operations/snapshot.js.map +1 -0
- package/dist-esm/src/operations/snapshots.d.ts +35 -0
- package/dist-esm/src/operations/snapshots.d.ts.map +1 -0
- package/dist-esm/src/operations/snapshots.js +137 -0
- package/dist-esm/src/operations/snapshots.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.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/report.d.ts +52 -0
- package/dist-esm/src/operationsInterfaces/report.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/report.js +9 -0
- package/dist-esm/src/operationsInterfaces/report.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/reports.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/reports.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/reports.js +9 -0
- package/dist-esm/src/operationsInterfaces/reports.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/snapshot.d.ts +29 -0
- package/dist-esm/src/operationsInterfaces/snapshot.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/snapshot.js +9 -0
- package/dist-esm/src/operationsInterfaces/snapshot.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/snapshots.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/snapshots.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/snapshots.js +9 -0
- package/dist-esm/src/operationsInterfaces/snapshots.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +38 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +122 -0
- package/review/arm-appcomplianceautomation.api.md +588 -0
- package/rollup.config.js +122 -0
- package/src/appComplianceAutomationToolForMicrosoft365.ts +153 -0
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1144 -0
- package/src/models/mappers.ts +1207 -0
- package/src/models/parameters.ts +181 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/operations.ts +137 -0
- package/src/operations/report.ts +388 -0
- package/src/operations/reports.ts +151 -0
- package/src/operations/snapshot.ts +201 -0
- package/src/operations/snapshots.ts +163 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/report.ts +102 -0
- package/src/operationsInterfaces/reports.ts +22 -0
- package/src/operationsInterfaces/snapshot.ts +62 -0
- package/src/operationsInterfaces/snapshots.ts +24 -0
- package/tsconfig.json +33 -0
- package/types/arm-appcomplianceautomation.d.ts +1261 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
ReportResource as ReportResourceMapper,
|
|
16
|
+
ReportResourcePatch as ReportResourcePatchMapper,
|
|
17
|
+
SnapshotDownloadRequest as SnapshotDownloadRequestMapper
|
|
18
|
+
} from "../models/mappers";
|
|
19
|
+
|
|
20
|
+
export const accept: OperationParameter = {
|
|
21
|
+
parameterPath: "accept",
|
|
22
|
+
mapper: {
|
|
23
|
+
defaultValue: "application/json",
|
|
24
|
+
isConstant: true,
|
|
25
|
+
serializedName: "Accept",
|
|
26
|
+
type: {
|
|
27
|
+
name: "String"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const $host: OperationURLParameter = {
|
|
33
|
+
parameterPath: "$host",
|
|
34
|
+
mapper: {
|
|
35
|
+
serializedName: "$host",
|
|
36
|
+
required: true,
|
|
37
|
+
type: {
|
|
38
|
+
name: "String"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
skipEncoding: true
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const apiVersion: OperationQueryParameter = {
|
|
45
|
+
parameterPath: "apiVersion",
|
|
46
|
+
mapper: {
|
|
47
|
+
defaultValue: "2022-11-16-preview",
|
|
48
|
+
isConstant: true,
|
|
49
|
+
serializedName: "api-version",
|
|
50
|
+
type: {
|
|
51
|
+
name: "String"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const nextLink: OperationURLParameter = {
|
|
57
|
+
parameterPath: "nextLink",
|
|
58
|
+
mapper: {
|
|
59
|
+
serializedName: "nextLink",
|
|
60
|
+
required: true,
|
|
61
|
+
type: {
|
|
62
|
+
name: "String"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
skipEncoding: true
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const skipToken: OperationQueryParameter = {
|
|
69
|
+
parameterPath: ["options", "skipToken"],
|
|
70
|
+
mapper: {
|
|
71
|
+
serializedName: "$skipToken",
|
|
72
|
+
type: {
|
|
73
|
+
name: "String"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const top: OperationQueryParameter = {
|
|
79
|
+
parameterPath: ["options", "top"],
|
|
80
|
+
mapper: {
|
|
81
|
+
constraints: {
|
|
82
|
+
InclusiveMaximum: 100,
|
|
83
|
+
InclusiveMinimum: 1
|
|
84
|
+
},
|
|
85
|
+
serializedName: "$top",
|
|
86
|
+
type: {
|
|
87
|
+
name: "Number"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const select: OperationQueryParameter = {
|
|
93
|
+
parameterPath: ["options", "select"],
|
|
94
|
+
mapper: {
|
|
95
|
+
constraints: {
|
|
96
|
+
MinLength: 1
|
|
97
|
+
},
|
|
98
|
+
serializedName: "$select",
|
|
99
|
+
type: {
|
|
100
|
+
name: "String"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const offerGuid: OperationQueryParameter = {
|
|
106
|
+
parameterPath: ["options", "offerGuid"],
|
|
107
|
+
mapper: {
|
|
108
|
+
constraints: {
|
|
109
|
+
MinLength: 1
|
|
110
|
+
},
|
|
111
|
+
serializedName: "offerGuid",
|
|
112
|
+
type: {
|
|
113
|
+
name: "String"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const reportCreatorTenantId: OperationQueryParameter = {
|
|
119
|
+
parameterPath: ["options", "reportCreatorTenantId"],
|
|
120
|
+
mapper: {
|
|
121
|
+
constraints: {
|
|
122
|
+
MinLength: 1
|
|
123
|
+
},
|
|
124
|
+
serializedName: "reportCreatorTenantId",
|
|
125
|
+
type: {
|
|
126
|
+
name: "String"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const reportName: OperationURLParameter = {
|
|
132
|
+
parameterPath: "reportName",
|
|
133
|
+
mapper: {
|
|
134
|
+
constraints: {
|
|
135
|
+
Pattern: new RegExp("^[-a-zA-Z0-9_]+$")
|
|
136
|
+
},
|
|
137
|
+
serializedName: "reportName",
|
|
138
|
+
required: true,
|
|
139
|
+
type: {
|
|
140
|
+
name: "String"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const contentType: OperationParameter = {
|
|
146
|
+
parameterPath: ["options", "contentType"],
|
|
147
|
+
mapper: {
|
|
148
|
+
defaultValue: "application/json",
|
|
149
|
+
isConstant: true,
|
|
150
|
+
serializedName: "Content-Type",
|
|
151
|
+
type: {
|
|
152
|
+
name: "String"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const parameters: OperationParameter = {
|
|
158
|
+
parameterPath: "parameters",
|
|
159
|
+
mapper: ReportResourceMapper
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const parameters1: OperationParameter = {
|
|
163
|
+
parameterPath: "parameters",
|
|
164
|
+
mapper: ReportResourcePatchMapper
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const snapshotName: OperationURLParameter = {
|
|
168
|
+
parameterPath: "snapshotName",
|
|
169
|
+
mapper: {
|
|
170
|
+
serializedName: "snapshotName",
|
|
171
|
+
required: true,
|
|
172
|
+
type: {
|
|
173
|
+
name: "String"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const parameters2: OperationParameter = {
|
|
179
|
+
parameterPath: "parameters",
|
|
180
|
+
mapper: SnapshotDownloadRequestMapper
|
|
181
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 "./operations";
|
|
10
|
+
export * from "./reports";
|
|
11
|
+
export * from "./report";
|
|
12
|
+
export * from "./snapshots";
|
|
13
|
+
export * from "./snapshot";
|
|
@@ -0,0 +1,137 @@
|
|
|
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 } from "@azure/core-paging";
|
|
10
|
+
import { Operations } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
13
|
+
import * as Parameters from "../models/parameters";
|
|
14
|
+
import { AppComplianceAutomationToolForMicrosoft365 } from "../appComplianceAutomationToolForMicrosoft365";
|
|
15
|
+
import {
|
|
16
|
+
Operation,
|
|
17
|
+
OperationsListNextOptionalParams,
|
|
18
|
+
OperationsListOptionalParams,
|
|
19
|
+
OperationsListResponse,
|
|
20
|
+
OperationsListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Operations operations. */
|
|
25
|
+
export class OperationsImpl implements Operations {
|
|
26
|
+
private readonly client: AppComplianceAutomationToolForMicrosoft365;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Operations class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: AppComplianceAutomationToolForMicrosoft365) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Lists all of the available REST API operations of the Microsoft.AppComplianceAutomation provider.
|
|
38
|
+
* @param options The options parameters.
|
|
39
|
+
*/
|
|
40
|
+
public list(
|
|
41
|
+
options?: OperationsListOptionalParams
|
|
42
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
43
|
+
const iter = this.listPagingAll(options);
|
|
44
|
+
return {
|
|
45
|
+
next() {
|
|
46
|
+
return iter.next();
|
|
47
|
+
},
|
|
48
|
+
[Symbol.asyncIterator]() {
|
|
49
|
+
return this;
|
|
50
|
+
},
|
|
51
|
+
byPage: () => {
|
|
52
|
+
return this.listPagingPage(options);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private async *listPagingPage(
|
|
58
|
+
options?: OperationsListOptionalParams
|
|
59
|
+
): AsyncIterableIterator<Operation[]> {
|
|
60
|
+
let result = await this._list(options);
|
|
61
|
+
yield result.value || [];
|
|
62
|
+
let continuationToken = result.nextLink;
|
|
63
|
+
while (continuationToken) {
|
|
64
|
+
result = await this._listNext(continuationToken, options);
|
|
65
|
+
continuationToken = result.nextLink;
|
|
66
|
+
yield result.value || [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private async *listPagingAll(
|
|
71
|
+
options?: OperationsListOptionalParams
|
|
72
|
+
): AsyncIterableIterator<Operation> {
|
|
73
|
+
for await (const page of this.listPagingPage(options)) {
|
|
74
|
+
yield* page;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Lists all of the available REST API operations of the Microsoft.AppComplianceAutomation provider.
|
|
80
|
+
* @param options The options parameters.
|
|
81
|
+
*/
|
|
82
|
+
private _list(
|
|
83
|
+
options?: OperationsListOptionalParams
|
|
84
|
+
): Promise<OperationsListResponse> {
|
|
85
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* ListNext
|
|
90
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
91
|
+
* @param options The options parameters.
|
|
92
|
+
*/
|
|
93
|
+
private _listNext(
|
|
94
|
+
nextLink: string,
|
|
95
|
+
options?: OperationsListNextOptionalParams
|
|
96
|
+
): Promise<OperationsListNextResponse> {
|
|
97
|
+
return this.client.sendOperationRequest(
|
|
98
|
+
{ nextLink, options },
|
|
99
|
+
listNextOperationSpec
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Operation Specifications
|
|
104
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
105
|
+
|
|
106
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
107
|
+
path: "/providers/Microsoft.AppComplianceAutomation/operations",
|
|
108
|
+
httpMethod: "GET",
|
|
109
|
+
responses: {
|
|
110
|
+
200: {
|
|
111
|
+
bodyMapper: Mappers.OperationListResult
|
|
112
|
+
},
|
|
113
|
+
default: {
|
|
114
|
+
bodyMapper: Mappers.ErrorResponse
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
queryParameters: [Parameters.apiVersion],
|
|
118
|
+
urlParameters: [Parameters.$host],
|
|
119
|
+
headerParameters: [Parameters.accept],
|
|
120
|
+
serializer
|
|
121
|
+
};
|
|
122
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
123
|
+
path: "{nextLink}",
|
|
124
|
+
httpMethod: "GET",
|
|
125
|
+
responses: {
|
|
126
|
+
200: {
|
|
127
|
+
bodyMapper: Mappers.OperationListResult
|
|
128
|
+
},
|
|
129
|
+
default: {
|
|
130
|
+
bodyMapper: Mappers.ErrorResponse
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
queryParameters: [Parameters.apiVersion],
|
|
134
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
135
|
+
headerParameters: [Parameters.accept],
|
|
136
|
+
serializer
|
|
137
|
+
};
|
|
@@ -0,0 +1,388 @@
|
|
|
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 { Report } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { AppComplianceAutomationToolForMicrosoft365 } from "../appComplianceAutomationToolForMicrosoft365";
|
|
14
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
15
|
+
import { LroImpl } from "../lroImpl";
|
|
16
|
+
import {
|
|
17
|
+
ReportGetOptionalParams,
|
|
18
|
+
ReportGetResponse,
|
|
19
|
+
ReportResource,
|
|
20
|
+
ReportCreateOrUpdateOptionalParams,
|
|
21
|
+
ReportCreateOrUpdateResponse,
|
|
22
|
+
ReportResourcePatch,
|
|
23
|
+
ReportUpdateOptionalParams,
|
|
24
|
+
ReportUpdateResponse,
|
|
25
|
+
ReportDeleteOptionalParams
|
|
26
|
+
} from "../models";
|
|
27
|
+
|
|
28
|
+
/** Class containing Report operations. */
|
|
29
|
+
export class ReportImpl implements Report {
|
|
30
|
+
private readonly client: AppComplianceAutomationToolForMicrosoft365;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Initialize a new instance of the class Report class.
|
|
34
|
+
* @param client Reference to the service client
|
|
35
|
+
*/
|
|
36
|
+
constructor(client: AppComplianceAutomationToolForMicrosoft365) {
|
|
37
|
+
this.client = client;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the AppComplianceAutomation report and its properties.
|
|
42
|
+
* @param reportName Report Name.
|
|
43
|
+
* @param options The options parameters.
|
|
44
|
+
*/
|
|
45
|
+
get(
|
|
46
|
+
reportName: string,
|
|
47
|
+
options?: ReportGetOptionalParams
|
|
48
|
+
): Promise<ReportGetResponse> {
|
|
49
|
+
return this.client.sendOperationRequest(
|
|
50
|
+
{ reportName, options },
|
|
51
|
+
getOperationSpec
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Create a new AppComplianceAutomation report or update an exiting AppComplianceAutomation report.
|
|
57
|
+
* @param reportName Report Name.
|
|
58
|
+
* @param parameters Parameters for the create or update operation
|
|
59
|
+
* @param options The options parameters.
|
|
60
|
+
*/
|
|
61
|
+
async beginCreateOrUpdate(
|
|
62
|
+
reportName: string,
|
|
63
|
+
parameters: ReportResource,
|
|
64
|
+
options?: ReportCreateOrUpdateOptionalParams
|
|
65
|
+
): Promise<
|
|
66
|
+
PollerLike<
|
|
67
|
+
PollOperationState<ReportCreateOrUpdateResponse>,
|
|
68
|
+
ReportCreateOrUpdateResponse
|
|
69
|
+
>
|
|
70
|
+
> {
|
|
71
|
+
const directSendOperation = async (
|
|
72
|
+
args: coreClient.OperationArguments,
|
|
73
|
+
spec: coreClient.OperationSpec
|
|
74
|
+
): Promise<ReportCreateOrUpdateResponse> => {
|
|
75
|
+
return this.client.sendOperationRequest(args, spec);
|
|
76
|
+
};
|
|
77
|
+
const sendOperation = async (
|
|
78
|
+
args: coreClient.OperationArguments,
|
|
79
|
+
spec: coreClient.OperationSpec
|
|
80
|
+
) => {
|
|
81
|
+
let currentRawResponse:
|
|
82
|
+
| coreClient.FullOperationResponse
|
|
83
|
+
| undefined = undefined;
|
|
84
|
+
const providedCallback = args.options?.onResponse;
|
|
85
|
+
const callback: coreClient.RawResponseCallback = (
|
|
86
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
87
|
+
flatResponse: unknown
|
|
88
|
+
) => {
|
|
89
|
+
currentRawResponse = rawResponse;
|
|
90
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
91
|
+
};
|
|
92
|
+
const updatedArgs = {
|
|
93
|
+
...args,
|
|
94
|
+
options: {
|
|
95
|
+
...args.options,
|
|
96
|
+
onResponse: callback
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
100
|
+
return {
|
|
101
|
+
flatResponse,
|
|
102
|
+
rawResponse: {
|
|
103
|
+
statusCode: currentRawResponse!.status,
|
|
104
|
+
body: currentRawResponse!.parsedBody,
|
|
105
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const lro = new LroImpl(
|
|
111
|
+
sendOperation,
|
|
112
|
+
{ reportName, parameters, options },
|
|
113
|
+
createOrUpdateOperationSpec
|
|
114
|
+
);
|
|
115
|
+
const poller = new LroEngine(lro, {
|
|
116
|
+
resumeFrom: options?.resumeFrom,
|
|
117
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
118
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
119
|
+
});
|
|
120
|
+
await poller.poll();
|
|
121
|
+
return poller;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Create a new AppComplianceAutomation report or update an exiting AppComplianceAutomation report.
|
|
126
|
+
* @param reportName Report Name.
|
|
127
|
+
* @param parameters Parameters for the create or update operation
|
|
128
|
+
* @param options The options parameters.
|
|
129
|
+
*/
|
|
130
|
+
async beginCreateOrUpdateAndWait(
|
|
131
|
+
reportName: string,
|
|
132
|
+
parameters: ReportResource,
|
|
133
|
+
options?: ReportCreateOrUpdateOptionalParams
|
|
134
|
+
): Promise<ReportCreateOrUpdateResponse> {
|
|
135
|
+
const poller = await this.beginCreateOrUpdate(
|
|
136
|
+
reportName,
|
|
137
|
+
parameters,
|
|
138
|
+
options
|
|
139
|
+
);
|
|
140
|
+
return poller.pollUntilDone();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Update an exiting AppComplianceAutomation report.
|
|
145
|
+
* @param reportName Report Name.
|
|
146
|
+
* @param parameters Parameters for the create or update operation
|
|
147
|
+
* @param options The options parameters.
|
|
148
|
+
*/
|
|
149
|
+
async beginUpdate(
|
|
150
|
+
reportName: string,
|
|
151
|
+
parameters: ReportResourcePatch,
|
|
152
|
+
options?: ReportUpdateOptionalParams
|
|
153
|
+
): Promise<
|
|
154
|
+
PollerLike<PollOperationState<ReportUpdateResponse>, ReportUpdateResponse>
|
|
155
|
+
> {
|
|
156
|
+
const directSendOperation = async (
|
|
157
|
+
args: coreClient.OperationArguments,
|
|
158
|
+
spec: coreClient.OperationSpec
|
|
159
|
+
): Promise<ReportUpdateResponse> => {
|
|
160
|
+
return this.client.sendOperationRequest(args, spec);
|
|
161
|
+
};
|
|
162
|
+
const sendOperation = async (
|
|
163
|
+
args: coreClient.OperationArguments,
|
|
164
|
+
spec: coreClient.OperationSpec
|
|
165
|
+
) => {
|
|
166
|
+
let currentRawResponse:
|
|
167
|
+
| coreClient.FullOperationResponse
|
|
168
|
+
| undefined = undefined;
|
|
169
|
+
const providedCallback = args.options?.onResponse;
|
|
170
|
+
const callback: coreClient.RawResponseCallback = (
|
|
171
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
172
|
+
flatResponse: unknown
|
|
173
|
+
) => {
|
|
174
|
+
currentRawResponse = rawResponse;
|
|
175
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
176
|
+
};
|
|
177
|
+
const updatedArgs = {
|
|
178
|
+
...args,
|
|
179
|
+
options: {
|
|
180
|
+
...args.options,
|
|
181
|
+
onResponse: callback
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
185
|
+
return {
|
|
186
|
+
flatResponse,
|
|
187
|
+
rawResponse: {
|
|
188
|
+
statusCode: currentRawResponse!.status,
|
|
189
|
+
body: currentRawResponse!.parsedBody,
|
|
190
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const lro = new LroImpl(
|
|
196
|
+
sendOperation,
|
|
197
|
+
{ reportName, parameters, options },
|
|
198
|
+
updateOperationSpec
|
|
199
|
+
);
|
|
200
|
+
const poller = new LroEngine(lro, {
|
|
201
|
+
resumeFrom: options?.resumeFrom,
|
|
202
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
203
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
204
|
+
});
|
|
205
|
+
await poller.poll();
|
|
206
|
+
return poller;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Update an exiting AppComplianceAutomation report.
|
|
211
|
+
* @param reportName Report Name.
|
|
212
|
+
* @param parameters Parameters for the create or update operation
|
|
213
|
+
* @param options The options parameters.
|
|
214
|
+
*/
|
|
215
|
+
async beginUpdateAndWait(
|
|
216
|
+
reportName: string,
|
|
217
|
+
parameters: ReportResourcePatch,
|
|
218
|
+
options?: ReportUpdateOptionalParams
|
|
219
|
+
): Promise<ReportUpdateResponse> {
|
|
220
|
+
const poller = await this.beginUpdate(reportName, parameters, options);
|
|
221
|
+
return poller.pollUntilDone();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Delete an AppComplianceAutomation report.
|
|
226
|
+
* @param reportName Report Name.
|
|
227
|
+
* @param options The options parameters.
|
|
228
|
+
*/
|
|
229
|
+
async beginDelete(
|
|
230
|
+
reportName: string,
|
|
231
|
+
options?: ReportDeleteOptionalParams
|
|
232
|
+
): Promise<PollerLike<PollOperationState<void>, void>> {
|
|
233
|
+
const directSendOperation = async (
|
|
234
|
+
args: coreClient.OperationArguments,
|
|
235
|
+
spec: coreClient.OperationSpec
|
|
236
|
+
): Promise<void> => {
|
|
237
|
+
return this.client.sendOperationRequest(args, spec);
|
|
238
|
+
};
|
|
239
|
+
const sendOperation = async (
|
|
240
|
+
args: coreClient.OperationArguments,
|
|
241
|
+
spec: coreClient.OperationSpec
|
|
242
|
+
) => {
|
|
243
|
+
let currentRawResponse:
|
|
244
|
+
| coreClient.FullOperationResponse
|
|
245
|
+
| undefined = undefined;
|
|
246
|
+
const providedCallback = args.options?.onResponse;
|
|
247
|
+
const callback: coreClient.RawResponseCallback = (
|
|
248
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
249
|
+
flatResponse: unknown
|
|
250
|
+
) => {
|
|
251
|
+
currentRawResponse = rawResponse;
|
|
252
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
253
|
+
};
|
|
254
|
+
const updatedArgs = {
|
|
255
|
+
...args,
|
|
256
|
+
options: {
|
|
257
|
+
...args.options,
|
|
258
|
+
onResponse: callback
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
262
|
+
return {
|
|
263
|
+
flatResponse,
|
|
264
|
+
rawResponse: {
|
|
265
|
+
statusCode: currentRawResponse!.status,
|
|
266
|
+
body: currentRawResponse!.parsedBody,
|
|
267
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const lro = new LroImpl(
|
|
273
|
+
sendOperation,
|
|
274
|
+
{ reportName, options },
|
|
275
|
+
deleteOperationSpec
|
|
276
|
+
);
|
|
277
|
+
const poller = new LroEngine(lro, {
|
|
278
|
+
resumeFrom: options?.resumeFrom,
|
|
279
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
280
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
281
|
+
});
|
|
282
|
+
await poller.poll();
|
|
283
|
+
return poller;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Delete an AppComplianceAutomation report.
|
|
288
|
+
* @param reportName Report Name.
|
|
289
|
+
* @param options The options parameters.
|
|
290
|
+
*/
|
|
291
|
+
async beginDeleteAndWait(
|
|
292
|
+
reportName: string,
|
|
293
|
+
options?: ReportDeleteOptionalParams
|
|
294
|
+
): Promise<void> {
|
|
295
|
+
const poller = await this.beginDelete(reportName, options);
|
|
296
|
+
return poller.pollUntilDone();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
// Operation Specifications
|
|
300
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
301
|
+
|
|
302
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
303
|
+
path: "/providers/Microsoft.AppComplianceAutomation/reports/{reportName}",
|
|
304
|
+
httpMethod: "GET",
|
|
305
|
+
responses: {
|
|
306
|
+
200: {
|
|
307
|
+
bodyMapper: Mappers.ReportResource
|
|
308
|
+
},
|
|
309
|
+
default: {
|
|
310
|
+
bodyMapper: Mappers.ErrorResponse
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
queryParameters: [Parameters.apiVersion],
|
|
314
|
+
urlParameters: [Parameters.$host, Parameters.reportName],
|
|
315
|
+
headerParameters: [Parameters.accept],
|
|
316
|
+
serializer
|
|
317
|
+
};
|
|
318
|
+
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
319
|
+
path: "/providers/Microsoft.AppComplianceAutomation/reports/{reportName}",
|
|
320
|
+
httpMethod: "PUT",
|
|
321
|
+
responses: {
|
|
322
|
+
200: {
|
|
323
|
+
bodyMapper: Mappers.ReportResource
|
|
324
|
+
},
|
|
325
|
+
201: {
|
|
326
|
+
bodyMapper: Mappers.ReportResource
|
|
327
|
+
},
|
|
328
|
+
202: {
|
|
329
|
+
bodyMapper: Mappers.ReportResource
|
|
330
|
+
},
|
|
331
|
+
204: {
|
|
332
|
+
bodyMapper: Mappers.ReportResource
|
|
333
|
+
},
|
|
334
|
+
default: {
|
|
335
|
+
bodyMapper: Mappers.ErrorResponse
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
requestBody: Parameters.parameters,
|
|
339
|
+
queryParameters: [Parameters.apiVersion],
|
|
340
|
+
urlParameters: [Parameters.$host, Parameters.reportName],
|
|
341
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
342
|
+
mediaType: "json",
|
|
343
|
+
serializer
|
|
344
|
+
};
|
|
345
|
+
const updateOperationSpec: coreClient.OperationSpec = {
|
|
346
|
+
path: "/providers/Microsoft.AppComplianceAutomation/reports/{reportName}",
|
|
347
|
+
httpMethod: "PATCH",
|
|
348
|
+
responses: {
|
|
349
|
+
200: {
|
|
350
|
+
bodyMapper: Mappers.ReportResource
|
|
351
|
+
},
|
|
352
|
+
201: {
|
|
353
|
+
bodyMapper: Mappers.ReportResource
|
|
354
|
+
},
|
|
355
|
+
202: {
|
|
356
|
+
bodyMapper: Mappers.ReportResource
|
|
357
|
+
},
|
|
358
|
+
204: {
|
|
359
|
+
bodyMapper: Mappers.ReportResource
|
|
360
|
+
},
|
|
361
|
+
default: {
|
|
362
|
+
bodyMapper: Mappers.ErrorResponse
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
requestBody: Parameters.parameters1,
|
|
366
|
+
queryParameters: [Parameters.apiVersion],
|
|
367
|
+
urlParameters: [Parameters.$host, Parameters.reportName],
|
|
368
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
369
|
+
mediaType: "json",
|
|
370
|
+
serializer
|
|
371
|
+
};
|
|
372
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
373
|
+
path: "/providers/Microsoft.AppComplianceAutomation/reports/{reportName}",
|
|
374
|
+
httpMethod: "DELETE",
|
|
375
|
+
responses: {
|
|
376
|
+
200: {},
|
|
377
|
+
201: {},
|
|
378
|
+
202: {},
|
|
379
|
+
204: {},
|
|
380
|
+
default: {
|
|
381
|
+
bodyMapper: Mappers.ErrorResponse
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
queryParameters: [Parameters.apiVersion],
|
|
385
|
+
urlParameters: [Parameters.$host, Parameters.reportName],
|
|
386
|
+
headerParameters: [Parameters.accept],
|
|
387
|
+
serializer
|
|
388
|
+
};
|