@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,151 @@
|
|
|
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 { Reports } 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
|
+
ReportResource,
|
|
17
|
+
ReportsListNextOptionalParams,
|
|
18
|
+
ReportsListOptionalParams,
|
|
19
|
+
ReportsListResponse,
|
|
20
|
+
ReportsListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Reports operations. */
|
|
25
|
+
export class ReportsImpl implements Reports {
|
|
26
|
+
private readonly client: AppComplianceAutomationToolForMicrosoft365;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Reports class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: AppComplianceAutomationToolForMicrosoft365) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get the AppComplianceAutomation report list for the tenant.
|
|
38
|
+
* @param options The options parameters.
|
|
39
|
+
*/
|
|
40
|
+
public list(
|
|
41
|
+
options?: ReportsListOptionalParams
|
|
42
|
+
): PagedAsyncIterableIterator<ReportResource> {
|
|
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?: ReportsListOptionalParams
|
|
59
|
+
): AsyncIterableIterator<ReportResource[]> {
|
|
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?: ReportsListOptionalParams
|
|
72
|
+
): AsyncIterableIterator<ReportResource> {
|
|
73
|
+
for await (const page of this.listPagingPage(options)) {
|
|
74
|
+
yield* page;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get the AppComplianceAutomation report list for the tenant.
|
|
80
|
+
* @param options The options parameters.
|
|
81
|
+
*/
|
|
82
|
+
private _list(
|
|
83
|
+
options?: ReportsListOptionalParams
|
|
84
|
+
): Promise<ReportsListResponse> {
|
|
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?: ReportsListNextOptionalParams
|
|
96
|
+
): Promise<ReportsListNextResponse> {
|
|
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/reports",
|
|
108
|
+
httpMethod: "GET",
|
|
109
|
+
responses: {
|
|
110
|
+
200: {
|
|
111
|
+
bodyMapper: Mappers.ReportResourceList
|
|
112
|
+
},
|
|
113
|
+
default: {
|
|
114
|
+
bodyMapper: Mappers.ErrorResponse
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
queryParameters: [
|
|
118
|
+
Parameters.apiVersion,
|
|
119
|
+
Parameters.skipToken,
|
|
120
|
+
Parameters.top,
|
|
121
|
+
Parameters.select,
|
|
122
|
+
Parameters.offerGuid,
|
|
123
|
+
Parameters.reportCreatorTenantId
|
|
124
|
+
],
|
|
125
|
+
urlParameters: [Parameters.$host],
|
|
126
|
+
headerParameters: [Parameters.accept],
|
|
127
|
+
serializer
|
|
128
|
+
};
|
|
129
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
130
|
+
path: "{nextLink}",
|
|
131
|
+
httpMethod: "GET",
|
|
132
|
+
responses: {
|
|
133
|
+
200: {
|
|
134
|
+
bodyMapper: Mappers.ReportResourceList
|
|
135
|
+
},
|
|
136
|
+
default: {
|
|
137
|
+
bodyMapper: Mappers.ErrorResponse
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
queryParameters: [
|
|
141
|
+
Parameters.apiVersion,
|
|
142
|
+
Parameters.skipToken,
|
|
143
|
+
Parameters.top,
|
|
144
|
+
Parameters.select,
|
|
145
|
+
Parameters.offerGuid,
|
|
146
|
+
Parameters.reportCreatorTenantId
|
|
147
|
+
],
|
|
148
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
149
|
+
headerParameters: [Parameters.accept],
|
|
150
|
+
serializer
|
|
151
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
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 { Snapshot } 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
|
+
SnapshotGetOptionalParams,
|
|
18
|
+
SnapshotGetResponse,
|
|
19
|
+
SnapshotDownloadRequest,
|
|
20
|
+
SnapshotDownloadOptionalParams,
|
|
21
|
+
SnapshotDownloadResponse
|
|
22
|
+
} from "../models";
|
|
23
|
+
|
|
24
|
+
/** Class containing Snapshot operations. */
|
|
25
|
+
export class SnapshotImpl implements Snapshot {
|
|
26
|
+
private readonly client: AppComplianceAutomationToolForMicrosoft365;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Snapshot class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: AppComplianceAutomationToolForMicrosoft365) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get the AppComplianceAutomation snapshot and its properties.
|
|
38
|
+
* @param reportName Report Name.
|
|
39
|
+
* @param snapshotName Snapshot Name.
|
|
40
|
+
* @param options The options parameters.
|
|
41
|
+
*/
|
|
42
|
+
get(
|
|
43
|
+
reportName: string,
|
|
44
|
+
snapshotName: string,
|
|
45
|
+
options?: SnapshotGetOptionalParams
|
|
46
|
+
): Promise<SnapshotGetResponse> {
|
|
47
|
+
return this.client.sendOperationRequest(
|
|
48
|
+
{ reportName, snapshotName, options },
|
|
49
|
+
getOperationSpec
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Download compliance needs from snapshot, like: Compliance Report, Resource List.
|
|
55
|
+
* @param reportName Report Name.
|
|
56
|
+
* @param snapshotName Snapshot Name.
|
|
57
|
+
* @param parameters Parameters for the query operation
|
|
58
|
+
* @param options The options parameters.
|
|
59
|
+
*/
|
|
60
|
+
async beginDownload(
|
|
61
|
+
reportName: string,
|
|
62
|
+
snapshotName: string,
|
|
63
|
+
parameters: SnapshotDownloadRequest,
|
|
64
|
+
options?: SnapshotDownloadOptionalParams
|
|
65
|
+
): Promise<
|
|
66
|
+
PollerLike<
|
|
67
|
+
PollOperationState<SnapshotDownloadResponse>,
|
|
68
|
+
SnapshotDownloadResponse
|
|
69
|
+
>
|
|
70
|
+
> {
|
|
71
|
+
const directSendOperation = async (
|
|
72
|
+
args: coreClient.OperationArguments,
|
|
73
|
+
spec: coreClient.OperationSpec
|
|
74
|
+
): Promise<SnapshotDownloadResponse> => {
|
|
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, snapshotName, parameters, options },
|
|
113
|
+
downloadOperationSpec
|
|
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
|
+
* Download compliance needs from snapshot, like: Compliance Report, Resource List.
|
|
126
|
+
* @param reportName Report Name.
|
|
127
|
+
* @param snapshotName Snapshot Name.
|
|
128
|
+
* @param parameters Parameters for the query operation
|
|
129
|
+
* @param options The options parameters.
|
|
130
|
+
*/
|
|
131
|
+
async beginDownloadAndWait(
|
|
132
|
+
reportName: string,
|
|
133
|
+
snapshotName: string,
|
|
134
|
+
parameters: SnapshotDownloadRequest,
|
|
135
|
+
options?: SnapshotDownloadOptionalParams
|
|
136
|
+
): Promise<SnapshotDownloadResponse> {
|
|
137
|
+
const poller = await this.beginDownload(
|
|
138
|
+
reportName,
|
|
139
|
+
snapshotName,
|
|
140
|
+
parameters,
|
|
141
|
+
options
|
|
142
|
+
);
|
|
143
|
+
return poller.pollUntilDone();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Operation Specifications
|
|
147
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
148
|
+
|
|
149
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
150
|
+
path:
|
|
151
|
+
"/providers/Microsoft.AppComplianceAutomation/reports/{reportName}/snapshots/{snapshotName}",
|
|
152
|
+
httpMethod: "GET",
|
|
153
|
+
responses: {
|
|
154
|
+
200: {
|
|
155
|
+
bodyMapper: Mappers.SnapshotResource
|
|
156
|
+
},
|
|
157
|
+
default: {
|
|
158
|
+
bodyMapper: Mappers.ErrorResponse
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
queryParameters: [Parameters.apiVersion],
|
|
162
|
+
urlParameters: [
|
|
163
|
+
Parameters.$host,
|
|
164
|
+
Parameters.reportName,
|
|
165
|
+
Parameters.snapshotName
|
|
166
|
+
],
|
|
167
|
+
headerParameters: [Parameters.accept],
|
|
168
|
+
serializer
|
|
169
|
+
};
|
|
170
|
+
const downloadOperationSpec: coreClient.OperationSpec = {
|
|
171
|
+
path:
|
|
172
|
+
"/providers/Microsoft.AppComplianceAutomation/reports/{reportName}/snapshots/{snapshotName}/download",
|
|
173
|
+
httpMethod: "POST",
|
|
174
|
+
responses: {
|
|
175
|
+
200: {
|
|
176
|
+
bodyMapper: Mappers.DownloadResponse
|
|
177
|
+
},
|
|
178
|
+
201: {
|
|
179
|
+
bodyMapper: Mappers.DownloadResponse
|
|
180
|
+
},
|
|
181
|
+
202: {
|
|
182
|
+
bodyMapper: Mappers.DownloadResponse
|
|
183
|
+
},
|
|
184
|
+
204: {
|
|
185
|
+
bodyMapper: Mappers.DownloadResponse
|
|
186
|
+
},
|
|
187
|
+
default: {
|
|
188
|
+
bodyMapper: Mappers.ErrorResponse
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
requestBody: Parameters.parameters2,
|
|
192
|
+
queryParameters: [Parameters.apiVersion],
|
|
193
|
+
urlParameters: [
|
|
194
|
+
Parameters.$host,
|
|
195
|
+
Parameters.reportName,
|
|
196
|
+
Parameters.snapshotName
|
|
197
|
+
],
|
|
198
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
199
|
+
mediaType: "json",
|
|
200
|
+
serializer
|
|
201
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
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 { Snapshots } 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
|
+
SnapshotResource,
|
|
17
|
+
SnapshotsListNextOptionalParams,
|
|
18
|
+
SnapshotsListOptionalParams,
|
|
19
|
+
SnapshotsListResponse,
|
|
20
|
+
SnapshotsListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Snapshots operations. */
|
|
25
|
+
export class SnapshotsImpl implements Snapshots {
|
|
26
|
+
private readonly client: AppComplianceAutomationToolForMicrosoft365;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Snapshots class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: AppComplianceAutomationToolForMicrosoft365) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get the AppComplianceAutomation snapshot list.
|
|
38
|
+
* @param reportName Report Name.
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
reportName: string,
|
|
43
|
+
options?: SnapshotsListOptionalParams
|
|
44
|
+
): PagedAsyncIterableIterator<SnapshotResource> {
|
|
45
|
+
const iter = this.listPagingAll(reportName, options);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
},
|
|
53
|
+
byPage: () => {
|
|
54
|
+
return this.listPagingPage(reportName, options);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private async *listPagingPage(
|
|
60
|
+
reportName: string,
|
|
61
|
+
options?: SnapshotsListOptionalParams
|
|
62
|
+
): AsyncIterableIterator<SnapshotResource[]> {
|
|
63
|
+
let result = await this._list(reportName, options);
|
|
64
|
+
yield result.value || [];
|
|
65
|
+
let continuationToken = result.nextLink;
|
|
66
|
+
while (continuationToken) {
|
|
67
|
+
result = await this._listNext(reportName, continuationToken, options);
|
|
68
|
+
continuationToken = result.nextLink;
|
|
69
|
+
yield result.value || [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private async *listPagingAll(
|
|
74
|
+
reportName: string,
|
|
75
|
+
options?: SnapshotsListOptionalParams
|
|
76
|
+
): AsyncIterableIterator<SnapshotResource> {
|
|
77
|
+
for await (const page of this.listPagingPage(reportName, options)) {
|
|
78
|
+
yield* page;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get the AppComplianceAutomation snapshot list.
|
|
84
|
+
* @param reportName Report Name.
|
|
85
|
+
* @param options The options parameters.
|
|
86
|
+
*/
|
|
87
|
+
private _list(
|
|
88
|
+
reportName: string,
|
|
89
|
+
options?: SnapshotsListOptionalParams
|
|
90
|
+
): Promise<SnapshotsListResponse> {
|
|
91
|
+
return this.client.sendOperationRequest(
|
|
92
|
+
{ reportName, options },
|
|
93
|
+
listOperationSpec
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* ListNext
|
|
99
|
+
* @param reportName Report Name.
|
|
100
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
101
|
+
* @param options The options parameters.
|
|
102
|
+
*/
|
|
103
|
+
private _listNext(
|
|
104
|
+
reportName: string,
|
|
105
|
+
nextLink: string,
|
|
106
|
+
options?: SnapshotsListNextOptionalParams
|
|
107
|
+
): Promise<SnapshotsListNextResponse> {
|
|
108
|
+
return this.client.sendOperationRequest(
|
|
109
|
+
{ reportName, nextLink, options },
|
|
110
|
+
listNextOperationSpec
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Operation Specifications
|
|
115
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
116
|
+
|
|
117
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
118
|
+
path:
|
|
119
|
+
"/providers/Microsoft.AppComplianceAutomation/reports/{reportName}/snapshots",
|
|
120
|
+
httpMethod: "GET",
|
|
121
|
+
responses: {
|
|
122
|
+
200: {
|
|
123
|
+
bodyMapper: Mappers.SnapshotResourceList
|
|
124
|
+
},
|
|
125
|
+
default: {
|
|
126
|
+
bodyMapper: Mappers.ErrorResponse
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
queryParameters: [
|
|
130
|
+
Parameters.apiVersion,
|
|
131
|
+
Parameters.skipToken,
|
|
132
|
+
Parameters.top,
|
|
133
|
+
Parameters.select,
|
|
134
|
+
Parameters.offerGuid,
|
|
135
|
+
Parameters.reportCreatorTenantId
|
|
136
|
+
],
|
|
137
|
+
urlParameters: [Parameters.$host, Parameters.reportName],
|
|
138
|
+
headerParameters: [Parameters.accept],
|
|
139
|
+
serializer
|
|
140
|
+
};
|
|
141
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
142
|
+
path: "{nextLink}",
|
|
143
|
+
httpMethod: "GET",
|
|
144
|
+
responses: {
|
|
145
|
+
200: {
|
|
146
|
+
bodyMapper: Mappers.SnapshotResourceList
|
|
147
|
+
},
|
|
148
|
+
default: {
|
|
149
|
+
bodyMapper: Mappers.ErrorResponse
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
queryParameters: [
|
|
153
|
+
Parameters.apiVersion,
|
|
154
|
+
Parameters.skipToken,
|
|
155
|
+
Parameters.top,
|
|
156
|
+
Parameters.select,
|
|
157
|
+
Parameters.offerGuid,
|
|
158
|
+
Parameters.reportCreatorTenantId
|
|
159
|
+
],
|
|
160
|
+
urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.reportName],
|
|
161
|
+
headerParameters: [Parameters.accept],
|
|
162
|
+
serializer
|
|
163
|
+
};
|
|
@@ -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,22 @@
|
|
|
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 { Operation, OperationsListOptionalParams } from "../models";
|
|
11
|
+
|
|
12
|
+
/// <reference lib="esnext.asynciterable" />
|
|
13
|
+
/** Interface representing a Operations. */
|
|
14
|
+
export interface Operations {
|
|
15
|
+
/**
|
|
16
|
+
* Lists all of the available REST API operations of the Microsoft.AppComplianceAutomation provider.
|
|
17
|
+
* @param options The options parameters.
|
|
18
|
+
*/
|
|
19
|
+
list(
|
|
20
|
+
options?: OperationsListOptionalParams
|
|
21
|
+
): PagedAsyncIterableIterator<Operation>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 { PollerLike, PollOperationState } from "@azure/core-lro";
|
|
10
|
+
import {
|
|
11
|
+
ReportGetOptionalParams,
|
|
12
|
+
ReportGetResponse,
|
|
13
|
+
ReportResource,
|
|
14
|
+
ReportCreateOrUpdateOptionalParams,
|
|
15
|
+
ReportCreateOrUpdateResponse,
|
|
16
|
+
ReportResourcePatch,
|
|
17
|
+
ReportUpdateOptionalParams,
|
|
18
|
+
ReportUpdateResponse,
|
|
19
|
+
ReportDeleteOptionalParams
|
|
20
|
+
} from "../models";
|
|
21
|
+
|
|
22
|
+
/** Interface representing a Report. */
|
|
23
|
+
export interface Report {
|
|
24
|
+
/**
|
|
25
|
+
* Get the AppComplianceAutomation report and its properties.
|
|
26
|
+
* @param reportName Report Name.
|
|
27
|
+
* @param options The options parameters.
|
|
28
|
+
*/
|
|
29
|
+
get(
|
|
30
|
+
reportName: string,
|
|
31
|
+
options?: ReportGetOptionalParams
|
|
32
|
+
): Promise<ReportGetResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Create a new AppComplianceAutomation report or update an exiting AppComplianceAutomation report.
|
|
35
|
+
* @param reportName Report Name.
|
|
36
|
+
* @param parameters Parameters for the create or update operation
|
|
37
|
+
* @param options The options parameters.
|
|
38
|
+
*/
|
|
39
|
+
beginCreateOrUpdate(
|
|
40
|
+
reportName: string,
|
|
41
|
+
parameters: ReportResource,
|
|
42
|
+
options?: ReportCreateOrUpdateOptionalParams
|
|
43
|
+
): Promise<
|
|
44
|
+
PollerLike<
|
|
45
|
+
PollOperationState<ReportCreateOrUpdateResponse>,
|
|
46
|
+
ReportCreateOrUpdateResponse
|
|
47
|
+
>
|
|
48
|
+
>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a new AppComplianceAutomation report or update an exiting AppComplianceAutomation report.
|
|
51
|
+
* @param reportName Report Name.
|
|
52
|
+
* @param parameters Parameters for the create or update operation
|
|
53
|
+
* @param options The options parameters.
|
|
54
|
+
*/
|
|
55
|
+
beginCreateOrUpdateAndWait(
|
|
56
|
+
reportName: string,
|
|
57
|
+
parameters: ReportResource,
|
|
58
|
+
options?: ReportCreateOrUpdateOptionalParams
|
|
59
|
+
): Promise<ReportCreateOrUpdateResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Update an exiting AppComplianceAutomation report.
|
|
62
|
+
* @param reportName Report Name.
|
|
63
|
+
* @param parameters Parameters for the create or update operation
|
|
64
|
+
* @param options The options parameters.
|
|
65
|
+
*/
|
|
66
|
+
beginUpdate(
|
|
67
|
+
reportName: string,
|
|
68
|
+
parameters: ReportResourcePatch,
|
|
69
|
+
options?: ReportUpdateOptionalParams
|
|
70
|
+
): Promise<
|
|
71
|
+
PollerLike<PollOperationState<ReportUpdateResponse>, ReportUpdateResponse>
|
|
72
|
+
>;
|
|
73
|
+
/**
|
|
74
|
+
* Update an exiting AppComplianceAutomation report.
|
|
75
|
+
* @param reportName Report Name.
|
|
76
|
+
* @param parameters Parameters for the create or update operation
|
|
77
|
+
* @param options The options parameters.
|
|
78
|
+
*/
|
|
79
|
+
beginUpdateAndWait(
|
|
80
|
+
reportName: string,
|
|
81
|
+
parameters: ReportResourcePatch,
|
|
82
|
+
options?: ReportUpdateOptionalParams
|
|
83
|
+
): Promise<ReportUpdateResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Delete an AppComplianceAutomation report.
|
|
86
|
+
* @param reportName Report Name.
|
|
87
|
+
* @param options The options parameters.
|
|
88
|
+
*/
|
|
89
|
+
beginDelete(
|
|
90
|
+
reportName: string,
|
|
91
|
+
options?: ReportDeleteOptionalParams
|
|
92
|
+
): Promise<PollerLike<PollOperationState<void>, void>>;
|
|
93
|
+
/**
|
|
94
|
+
* Delete an AppComplianceAutomation report.
|
|
95
|
+
* @param reportName Report Name.
|
|
96
|
+
* @param options The options parameters.
|
|
97
|
+
*/
|
|
98
|
+
beginDeleteAndWait(
|
|
99
|
+
reportName: string,
|
|
100
|
+
options?: ReportDeleteOptionalParams
|
|
101
|
+
): Promise<void>;
|
|
102
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { ReportResource, ReportsListOptionalParams } from "../models";
|
|
11
|
+
|
|
12
|
+
/// <reference lib="esnext.asynciterable" />
|
|
13
|
+
/** Interface representing a Reports. */
|
|
14
|
+
export interface Reports {
|
|
15
|
+
/**
|
|
16
|
+
* Get the AppComplianceAutomation report list for the tenant.
|
|
17
|
+
* @param options The options parameters.
|
|
18
|
+
*/
|
|
19
|
+
list(
|
|
20
|
+
options?: ReportsListOptionalParams
|
|
21
|
+
): PagedAsyncIterableIterator<ReportResource>;
|
|
22
|
+
}
|