@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.
Files changed (143) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +2463 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/operationsListSample.js +42 -0
  11. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/reportCreateOrUpdateSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/reportCreateOrUpdateSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/reportCreateOrUpdateSample.js +42 -0
  15. package/dist-esm/samples-dev/reportCreateOrUpdateSample.js.map +1 -0
  16. package/dist-esm/samples-dev/reportDeleteSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/reportDeleteSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/reportDeleteSample.js +29 -0
  19. package/dist-esm/samples-dev/reportDeleteSample.js.map +1 -0
  20. package/dist-esm/samples-dev/reportGetSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/reportGetSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/reportGetSample.js +29 -0
  23. package/dist-esm/samples-dev/reportGetSample.js.map +1 -0
  24. package/dist-esm/samples-dev/reportUpdateSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/reportUpdateSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/reportUpdateSample.js +42 -0
  27. package/dist-esm/samples-dev/reportUpdateSample.js.map +1 -0
  28. package/dist-esm/samples-dev/reportsListSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/reportsListSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/reportsListSample.js +52 -0
  31. package/dist-esm/samples-dev/reportsListSample.js.map +1 -0
  32. package/dist-esm/samples-dev/snapshotDownloadSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/snapshotDownloadSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/snapshotDownloadSample.js +101 -0
  35. package/dist-esm/samples-dev/snapshotDownloadSample.js.map +1 -0
  36. package/dist-esm/samples-dev/snapshotGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/snapshotGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/snapshotGetSample.js +30 -0
  39. package/dist-esm/samples-dev/snapshotGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/snapshotsListSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/snapshotsListSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/snapshotsListSample.js +53 -0
  43. package/dist-esm/samples-dev/snapshotsListSample.js.map +1 -0
  44. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.d.ts +22 -0
  45. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.d.ts.map +1 -0
  46. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js +101 -0
  47. package/dist-esm/src/appComplianceAutomationToolForMicrosoft365.js.map +1 -0
  48. package/dist-esm/src/index.d.ts +5 -0
  49. package/dist-esm/src/index.d.ts.map +1 -0
  50. package/dist-esm/src/index.js +12 -0
  51. package/dist-esm/src/index.js.map +1 -0
  52. package/dist-esm/src/lroImpl.d.ts +16 -0
  53. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  54. package/dist-esm/src/lroImpl.js +29 -0
  55. package/dist-esm/src/lroImpl.js.map +1 -0
  56. package/dist-esm/src/models/index.d.ts +1046 -0
  57. package/dist-esm/src/models/index.d.ts.map +1 -0
  58. package/dist-esm/src/models/index.js +166 -0
  59. package/dist-esm/src/models/index.js.map +1 -0
  60. package/dist-esm/src/models/mappers.d.ts +33 -0
  61. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  62. package/dist-esm/src/models/mappers.js +1167 -0
  63. package/dist-esm/src/models/mappers.js.map +1 -0
  64. package/dist-esm/src/models/parameters.d.ts +17 -0
  65. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  66. package/dist-esm/src/models/parameters.js +157 -0
  67. package/dist-esm/src/models/parameters.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +6 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +13 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operations.d.ts +32 -0
  73. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operations.js +120 -0
  75. package/dist-esm/src/operations/operations.js.map +1 -0
  76. package/dist-esm/src/operations/report.d.ts +60 -0
  77. package/dist-esm/src/operations/report.d.ts.map +1 -0
  78. package/dist-esm/src/operations/report.js +275 -0
  79. package/dist-esm/src/operations/report.js.map +1 -0
  80. package/dist-esm/src/operations/reports.d.ts +32 -0
  81. package/dist-esm/src/operations/reports.d.ts.map +1 -0
  82. package/dist-esm/src/operations/reports.js +134 -0
  83. package/dist-esm/src/operations/reports.js.map +1 -0
  84. package/dist-esm/src/operations/snapshot.d.ts +37 -0
  85. package/dist-esm/src/operations/snapshot.d.ts.map +1 -0
  86. package/dist-esm/src/operations/snapshot.js +140 -0
  87. package/dist-esm/src/operations/snapshot.js.map +1 -0
  88. package/dist-esm/src/operations/snapshots.d.ts +35 -0
  89. package/dist-esm/src/operations/snapshots.d.ts.map +1 -0
  90. package/dist-esm/src/operations/snapshots.js +137 -0
  91. package/dist-esm/src/operations/snapshots.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  93. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  95. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  97. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  98. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  99. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/report.d.ts +52 -0
  101. package/dist-esm/src/operationsInterfaces/report.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/report.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/report.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/reports.d.ts +11 -0
  105. package/dist-esm/src/operationsInterfaces/reports.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/reports.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/reports.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/snapshot.d.ts +29 -0
  109. package/dist-esm/src/operationsInterfaces/snapshot.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/snapshot.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/snapshot.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/snapshots.d.ts +12 -0
  113. package/dist-esm/src/operationsInterfaces/snapshots.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/snapshots.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/snapshots.js.map +1 -0
  116. package/dist-esm/test/sampleTest.d.ts +2 -0
  117. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  118. package/dist-esm/test/sampleTest.js +38 -0
  119. package/dist-esm/test/sampleTest.js.map +1 -0
  120. package/package.json +122 -0
  121. package/review/arm-appcomplianceautomation.api.md +588 -0
  122. package/rollup.config.js +122 -0
  123. package/src/appComplianceAutomationToolForMicrosoft365.ts +153 -0
  124. package/src/index.ts +12 -0
  125. package/src/lroImpl.ts +34 -0
  126. package/src/models/index.ts +1144 -0
  127. package/src/models/mappers.ts +1207 -0
  128. package/src/models/parameters.ts +181 -0
  129. package/src/operations/index.ts +13 -0
  130. package/src/operations/operations.ts +137 -0
  131. package/src/operations/report.ts +388 -0
  132. package/src/operations/reports.ts +151 -0
  133. package/src/operations/snapshot.ts +201 -0
  134. package/src/operations/snapshots.ts +163 -0
  135. package/src/operationsInterfaces/index.ts +13 -0
  136. package/src/operationsInterfaces/operations.ts +22 -0
  137. package/src/operationsInterfaces/report.ts +102 -0
  138. package/src/operationsInterfaces/reports.ts +22 -0
  139. package/src/operationsInterfaces/snapshot.ts +62 -0
  140. package/src/operationsInterfaces/snapshots.ts +24 -0
  141. package/tsconfig.json +33 -0
  142. package/types/arm-appcomplianceautomation.d.ts +1261 -0
  143. 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
+ }