@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,153 @@
|
|
|
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 * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
16
|
+
import * as coreAuth from "@azure/core-auth";
|
|
17
|
+
import {
|
|
18
|
+
OperationsImpl,
|
|
19
|
+
ReportsImpl,
|
|
20
|
+
ReportImpl,
|
|
21
|
+
SnapshotsImpl,
|
|
22
|
+
SnapshotImpl
|
|
23
|
+
} from "./operations";
|
|
24
|
+
import {
|
|
25
|
+
Operations,
|
|
26
|
+
Reports,
|
|
27
|
+
Report,
|
|
28
|
+
Snapshots,
|
|
29
|
+
Snapshot
|
|
30
|
+
} from "./operationsInterfaces";
|
|
31
|
+
import { AppComplianceAutomationToolForMicrosoft365OptionalParams } from "./models";
|
|
32
|
+
|
|
33
|
+
export class AppComplianceAutomationToolForMicrosoft365 extends coreClient.ServiceClient {
|
|
34
|
+
$host: string;
|
|
35
|
+
apiVersion: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Initializes a new instance of the AppComplianceAutomationToolForMicrosoft365 class.
|
|
39
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
40
|
+
* @param options The parameter options
|
|
41
|
+
*/
|
|
42
|
+
constructor(
|
|
43
|
+
credentials: coreAuth.TokenCredential,
|
|
44
|
+
options?: AppComplianceAutomationToolForMicrosoft365OptionalParams
|
|
45
|
+
) {
|
|
46
|
+
if (credentials === undefined) {
|
|
47
|
+
throw new Error("'credentials' cannot be null");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Initializing default values for options
|
|
51
|
+
if (!options) {
|
|
52
|
+
options = {};
|
|
53
|
+
}
|
|
54
|
+
const defaults: AppComplianceAutomationToolForMicrosoft365OptionalParams = {
|
|
55
|
+
requestContentType: "application/json; charset=utf-8",
|
|
56
|
+
credential: credentials
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const packageDetails = `azsdk-js-arm-appcomplianceautomation/1.0.0-beta.1`;
|
|
60
|
+
const userAgentPrefix =
|
|
61
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
62
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
63
|
+
: `${packageDetails}`;
|
|
64
|
+
|
|
65
|
+
if (!options.credentialScopes) {
|
|
66
|
+
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
67
|
+
}
|
|
68
|
+
const optionsWithDefaults = {
|
|
69
|
+
...defaults,
|
|
70
|
+
...options,
|
|
71
|
+
userAgentOptions: {
|
|
72
|
+
userAgentPrefix
|
|
73
|
+
},
|
|
74
|
+
baseUri:
|
|
75
|
+
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
76
|
+
};
|
|
77
|
+
super(optionsWithDefaults);
|
|
78
|
+
|
|
79
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
80
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
81
|
+
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
82
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
83
|
+
(pipelinePolicy) =>
|
|
84
|
+
pipelinePolicy.name ===
|
|
85
|
+
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
if (
|
|
89
|
+
!options ||
|
|
90
|
+
!options.pipeline ||
|
|
91
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
92
|
+
!bearerTokenAuthenticationPolicyFound
|
|
93
|
+
) {
|
|
94
|
+
this.pipeline.removePolicy({
|
|
95
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
96
|
+
});
|
|
97
|
+
this.pipeline.addPolicy(
|
|
98
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
99
|
+
credential: credentials,
|
|
100
|
+
scopes: `${optionsWithDefaults.credentialScopes}`,
|
|
101
|
+
challengeCallbacks: {
|
|
102
|
+
authorizeRequestOnChallenge:
|
|
103
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Assigning values to Constant parameters
|
|
110
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
111
|
+
this.apiVersion = options.apiVersion || "2022-11-16-preview";
|
|
112
|
+
this.operations = new OperationsImpl(this);
|
|
113
|
+
this.reports = new ReportsImpl(this);
|
|
114
|
+
this.report = new ReportImpl(this);
|
|
115
|
+
this.snapshots = new SnapshotsImpl(this);
|
|
116
|
+
this.snapshot = new SnapshotImpl(this);
|
|
117
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
121
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
122
|
+
if (!apiVersion) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const apiVersionPolicy = {
|
|
126
|
+
name: "CustomApiVersionPolicy",
|
|
127
|
+
async sendRequest(
|
|
128
|
+
request: PipelineRequest,
|
|
129
|
+
next: SendRequest
|
|
130
|
+
): Promise<PipelineResponse> {
|
|
131
|
+
const param = request.url.split("?");
|
|
132
|
+
if (param.length > 1) {
|
|
133
|
+
const newParams = param[1].split("&").map((item) => {
|
|
134
|
+
if (item.indexOf("api-version") > -1) {
|
|
135
|
+
return "api-version=" + apiVersion;
|
|
136
|
+
} else {
|
|
137
|
+
return item;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
141
|
+
}
|
|
142
|
+
return next(request);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
operations: Operations;
|
|
149
|
+
reports: Reports;
|
|
150
|
+
report: Report;
|
|
151
|
+
snapshots: Snapshots;
|
|
152
|
+
snapshot: Snapshot;
|
|
153
|
+
}
|
package/src/index.ts
ADDED
|
@@ -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
|
+
/// <reference lib="esnext.asynciterable" />
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export { AppComplianceAutomationToolForMicrosoft365 } from "./appComplianceAutomationToolForMicrosoft365";
|
|
12
|
+
export * from "./operationsInterfaces";
|
package/src/lroImpl.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
|
10
|
+
|
|
11
|
+
export class LroImpl<T> implements LongRunningOperation<T> {
|
|
12
|
+
constructor(
|
|
13
|
+
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
|
|
14
|
+
private args: Record<string, unknown>,
|
|
15
|
+
private spec: {
|
|
16
|
+
readonly requestBody?: unknown;
|
|
17
|
+
readonly path?: string;
|
|
18
|
+
readonly httpMethod: string;
|
|
19
|
+
} & Record<string, any>,
|
|
20
|
+
public requestPath: string = spec.path!,
|
|
21
|
+
public requestMethod: string = spec.httpMethod
|
|
22
|
+
) {}
|
|
23
|
+
public async sendInitialRequest(): Promise<LroResponse<T>> {
|
|
24
|
+
return this.sendOperationFn(this.args, this.spec);
|
|
25
|
+
}
|
|
26
|
+
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
|
|
27
|
+
const { requestBody, ...restSpec } = this.spec;
|
|
28
|
+
return this.sendOperationFn(this.args, {
|
|
29
|
+
...restSpec,
|
|
30
|
+
path,
|
|
31
|
+
httpMethod: "GET"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|