@azure-rest/purview-scanning 1.0.0-beta.2 → 1.0.0-beta.4
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 +16 -0
- package/LICENSE +3 -3
- package/README.md +22 -33
- package/dist/browser/clientDefinitions.d.ts +277 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +60 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/dist/browser/isUnexpected.js +135 -0
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models.d.ts +1978 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +2269 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +202 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/pollingHelper.d.ts +76 -0
- package/dist/browser/pollingHelper.d.ts.map +1 -0
- package/dist/browser/pollingHelper.js +107 -0
- package/dist/browser/pollingHelper.js.map +1 -0
- package/dist/browser/purviewScanningRestClient.d.ts +16 -0
- package/dist/browser/purviewScanningRestClient.d.ts.map +1 -0
- package/dist/browser/purviewScanningRestClient.js +45 -0
- package/dist/browser/purviewScanningRestClient.js.map +1 -0
- package/dist/browser/responses.d.ts +940 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +277 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +17 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +60 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +138 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +1978 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +2269 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +140 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +202 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/pollingHelper.d.ts +76 -0
- package/dist/commonjs/pollingHelper.d.ts.map +1 -0
- package/dist/commonjs/pollingHelper.js +110 -0
- package/dist/commonjs/pollingHelper.js.map +1 -0
- package/dist/commonjs/purviewScanningRestClient.d.ts +16 -0
- package/dist/commonjs/purviewScanningRestClient.d.ts.map +1 -0
- package/dist/commonjs/purviewScanningRestClient.js +48 -0
- package/dist/commonjs/purviewScanningRestClient.js.map +1 -0
- package/dist/commonjs/responses.d.ts +940 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +277 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +60 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +135 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +1978 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +2269 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +137 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +202 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/pollingHelper.d.ts +76 -0
- package/dist/esm/pollingHelper.d.ts.map +1 -0
- package/dist/esm/pollingHelper.js +107 -0
- package/dist/esm/pollingHelper.js.map +1 -0
- package/dist/esm/purviewScanningRestClient.d.ts +16 -0
- package/dist/esm/purviewScanningRestClient.d.ts.map +1 -0
- package/dist/esm/purviewScanningRestClient.js +45 -0
- package/dist/esm/purviewScanningRestClient.js.map +1 -0
- package/dist/esm/responses.d.ts +940 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +277 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +12 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +14 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +60 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +135 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +1978 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +2269 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +137 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +202 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/pollingHelper.d.ts +76 -0
- package/dist/react-native/pollingHelper.d.ts.map +1 -0
- package/dist/react-native/pollingHelper.js +107 -0
- package/dist/react-native/pollingHelper.js.map +1 -0
- package/dist/react-native/purviewScanningRestClient.d.ts +16 -0
- package/dist/react-native/purviewScanningRestClient.d.ts.map +1 -0
- package/dist/react-native/purviewScanningRestClient.js +45 -0
- package/dist/react-native/purviewScanningRestClient.js.map +1 -0
- package/dist/react-native/responses.d.ts +940 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +90 -82
- package/review/purview-scanning-node.api.md +6615 -0
- package/dist/index.js +0 -90
- package/dist/index.js.map +0 -1
- package/dist-esm/src/index.js +0 -10
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/purviewScanning.js +0 -13
- package/dist-esm/src/purviewScanning.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/types/purview-scanning-rest.d.ts +0 -2681
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { RequestParameters } from "@azure-rest/core-client";
|
|
2
|
+
import type { AzureKeyVault, ClassificationRule, Credential, DataSource, Filter, IntegrationRuntime, IntegrationRuntimeRegenerateKeyParameters, EnableInteractiveQueryForIntegrationRuntimeRequest, ManagedVirtualNetwork, ManagedPrivateEndpoint, Scan, ScanRuleset, Trigger } from "./models.js";
|
|
3
|
+
export type KeyVaultConnectionsGetParameters = RequestParameters;
|
|
4
|
+
export interface KeyVaultConnectionsCreateOrReplaceBodyParam {
|
|
5
|
+
/** The Azure Key Vault connection definition. */
|
|
6
|
+
body: AzureKeyVault;
|
|
7
|
+
}
|
|
8
|
+
export interface KeyVaultConnectionsCreateOrReplaceMediaTypesParam {
|
|
9
|
+
/** Request content type */
|
|
10
|
+
contentType?: "application/json";
|
|
11
|
+
}
|
|
12
|
+
export type KeyVaultConnectionsCreateOrReplaceParameters = KeyVaultConnectionsCreateOrReplaceMediaTypesParam & KeyVaultConnectionsCreateOrReplaceBodyParam & RequestParameters;
|
|
13
|
+
export type KeyVaultConnectionsDeleteParameters = RequestParameters;
|
|
14
|
+
export type KeyVaultConnectionsListParameters = RequestParameters;
|
|
15
|
+
export type ClassificationRulesGetParameters = RequestParameters;
|
|
16
|
+
export interface ClassificationRulesCreateOrReplaceBodyParam {
|
|
17
|
+
/** The classification rule definition. */
|
|
18
|
+
body: ClassificationRule;
|
|
19
|
+
}
|
|
20
|
+
export interface ClassificationRulesCreateOrReplaceMediaTypesParam {
|
|
21
|
+
/** Request content type */
|
|
22
|
+
contentType?: "application/json";
|
|
23
|
+
}
|
|
24
|
+
export type ClassificationRulesCreateOrReplaceParameters = ClassificationRulesCreateOrReplaceMediaTypesParam & ClassificationRulesCreateOrReplaceBodyParam & RequestParameters;
|
|
25
|
+
export type ClassificationRulesDeleteParameters = RequestParameters;
|
|
26
|
+
export type ClassificationRulesListParameters = RequestParameters;
|
|
27
|
+
export type ClassificationRulesListVersionsByRuleNameParameters = RequestParameters;
|
|
28
|
+
export interface ClassificationRulesTagClassificationVersionQueryParamProperties {
|
|
29
|
+
/** The action of classification rule. */
|
|
30
|
+
action: "Keep" | "Delete";
|
|
31
|
+
}
|
|
32
|
+
export interface ClassificationRulesTagClassificationVersionQueryParam {
|
|
33
|
+
queryParameters: ClassificationRulesTagClassificationVersionQueryParamProperties;
|
|
34
|
+
}
|
|
35
|
+
export type ClassificationRulesTagClassificationVersionParameters = ClassificationRulesTagClassificationVersionQueryParam & RequestParameters;
|
|
36
|
+
export type CredentialGetParameters = RequestParameters;
|
|
37
|
+
export interface CredentialCreateOrReplaceBodyParam {
|
|
38
|
+
/** The credential definition. */
|
|
39
|
+
body: Credential;
|
|
40
|
+
}
|
|
41
|
+
export interface CredentialCreateOrReplaceMediaTypesParam {
|
|
42
|
+
/** Request content type */
|
|
43
|
+
contentType?: "application/json";
|
|
44
|
+
}
|
|
45
|
+
export type CredentialCreateOrReplaceParameters = CredentialCreateOrReplaceMediaTypesParam & CredentialCreateOrReplaceBodyParam & RequestParameters;
|
|
46
|
+
export type CredentialDeleteParameters = RequestParameters;
|
|
47
|
+
export type CredentialListParameters = RequestParameters;
|
|
48
|
+
export interface DataSourcesCreateOrReplaceBodyParam {
|
|
49
|
+
/** The data source definition. */
|
|
50
|
+
body: DataSource;
|
|
51
|
+
}
|
|
52
|
+
export interface DataSourcesCreateOrReplaceMediaTypesParam {
|
|
53
|
+
/** Request content type */
|
|
54
|
+
contentType?: "application/json";
|
|
55
|
+
}
|
|
56
|
+
export type DataSourcesCreateOrReplaceParameters = DataSourcesCreateOrReplaceMediaTypesParam & DataSourcesCreateOrReplaceBodyParam & RequestParameters;
|
|
57
|
+
export type DataSourcesGetParameters = RequestParameters;
|
|
58
|
+
export type DataSourcesDeleteParameters = RequestParameters;
|
|
59
|
+
export type DataSourcesListParameters = RequestParameters;
|
|
60
|
+
export type FiltersGetParameters = RequestParameters;
|
|
61
|
+
export interface FiltersCreateOrReplaceBodyParam {
|
|
62
|
+
/** The filter definition. */
|
|
63
|
+
body: Filter;
|
|
64
|
+
}
|
|
65
|
+
export interface FiltersCreateOrReplaceMediaTypesParam {
|
|
66
|
+
/** Request content type */
|
|
67
|
+
contentType?: "application/json";
|
|
68
|
+
}
|
|
69
|
+
export type FiltersCreateOrReplaceParameters = FiltersCreateOrReplaceMediaTypesParam & FiltersCreateOrReplaceBodyParam & RequestParameters;
|
|
70
|
+
export type IntegrationRuntimesListByAccountParameters = RequestParameters;
|
|
71
|
+
export type IntegrationRuntimesGetParameters = RequestParameters;
|
|
72
|
+
export type IntegrationRuntimesDeleteParameters = RequestParameters;
|
|
73
|
+
export interface IntegrationRuntimesCreateOrReplaceBodyParam {
|
|
74
|
+
/** The integration runtime definition. */
|
|
75
|
+
body: IntegrationRuntime;
|
|
76
|
+
}
|
|
77
|
+
export interface IntegrationRuntimesCreateOrReplaceMediaTypesParam {
|
|
78
|
+
/** Request content type */
|
|
79
|
+
contentType?: "application/json";
|
|
80
|
+
}
|
|
81
|
+
export type IntegrationRuntimesCreateOrReplaceParameters = IntegrationRuntimesCreateOrReplaceMediaTypesParam & IntegrationRuntimesCreateOrReplaceBodyParam & RequestParameters;
|
|
82
|
+
export type IntegrationRuntimesStatusParameters = RequestParameters;
|
|
83
|
+
export type IntegrationRuntimesListAuthKeysParameters = RequestParameters;
|
|
84
|
+
export interface IntegrationRuntimesRegenerateAuthKeyBodyParam {
|
|
85
|
+
/** The request of regenerating authentication key of an integration runtime. */
|
|
86
|
+
body: IntegrationRuntimeRegenerateKeyParameters;
|
|
87
|
+
}
|
|
88
|
+
export interface IntegrationRuntimesRegenerateAuthKeyMediaTypesParam {
|
|
89
|
+
/** Request content type */
|
|
90
|
+
contentType?: "application/json";
|
|
91
|
+
}
|
|
92
|
+
export type IntegrationRuntimesRegenerateAuthKeyParameters = IntegrationRuntimesRegenerateAuthKeyMediaTypesParam & IntegrationRuntimesRegenerateAuthKeyBodyParam & RequestParameters;
|
|
93
|
+
export type IntegrationRuntimesDisableInteractiveQueryParameters = RequestParameters;
|
|
94
|
+
export interface IntegrationRuntimesEnableInteractiveQueryBodyParam {
|
|
95
|
+
/** The request of enabling interactive query for integration runtime. */
|
|
96
|
+
body: EnableInteractiveQueryForIntegrationRuntimeRequest;
|
|
97
|
+
}
|
|
98
|
+
export interface IntegrationRuntimesEnableInteractiveQueryMediaTypesParam {
|
|
99
|
+
/** Request content type */
|
|
100
|
+
contentType?: "application/json";
|
|
101
|
+
}
|
|
102
|
+
export type IntegrationRuntimesEnableInteractiveQueryParameters = IntegrationRuntimesEnableInteractiveQueryMediaTypesParam & IntegrationRuntimesEnableInteractiveQueryBodyParam & RequestParameters;
|
|
103
|
+
export type ManagedVirtualNetworksListByAccountParameters = RequestParameters;
|
|
104
|
+
export type ManagedVirtualNetworksGetParameters = RequestParameters;
|
|
105
|
+
export interface ManagedVirtualNetworksCreateOrReplaceBodyParam {
|
|
106
|
+
/** The managed virtual network resource definition. */
|
|
107
|
+
body: ManagedVirtualNetwork;
|
|
108
|
+
}
|
|
109
|
+
export interface ManagedVirtualNetworksCreateOrReplaceMediaTypesParam {
|
|
110
|
+
/** Request content type */
|
|
111
|
+
contentType?: "application/json";
|
|
112
|
+
}
|
|
113
|
+
export type ManagedVirtualNetworksCreateOrReplaceParameters = ManagedVirtualNetworksCreateOrReplaceMediaTypesParam & ManagedVirtualNetworksCreateOrReplaceBodyParam & RequestParameters;
|
|
114
|
+
export type ManagedPrivateEndpointsListByAccountParameters = RequestParameters;
|
|
115
|
+
export type ManagedPrivateEndpointsGetParameters = RequestParameters;
|
|
116
|
+
export type ManagedPrivateEndpointsDeleteParameters = RequestParameters;
|
|
117
|
+
export interface ManagedPrivateEndpointsCreateOrReplaceBodyParam {
|
|
118
|
+
/** The managed private endpoint resource definition. */
|
|
119
|
+
body: ManagedPrivateEndpoint;
|
|
120
|
+
}
|
|
121
|
+
export interface ManagedPrivateEndpointsCreateOrReplaceMediaTypesParam {
|
|
122
|
+
/** Request content type */
|
|
123
|
+
contentType?: "application/json";
|
|
124
|
+
}
|
|
125
|
+
export type ManagedPrivateEndpointsCreateOrReplaceParameters = ManagedPrivateEndpointsCreateOrReplaceMediaTypesParam & ManagedPrivateEndpointsCreateOrReplaceBodyParam & RequestParameters;
|
|
126
|
+
export interface ScansCreateOrReplaceBodyParam {
|
|
127
|
+
/** The scan definition. */
|
|
128
|
+
body: Scan;
|
|
129
|
+
}
|
|
130
|
+
export interface ScansCreateOrReplaceMediaTypesParam {
|
|
131
|
+
/** Request content type */
|
|
132
|
+
contentType?: "application/json";
|
|
133
|
+
}
|
|
134
|
+
export type ScansCreateOrReplaceParameters = ScansCreateOrReplaceMediaTypesParam & ScansCreateOrReplaceBodyParam & RequestParameters;
|
|
135
|
+
export type ScansGetParameters = RequestParameters;
|
|
136
|
+
export type ScansDeleteParameters = RequestParameters;
|
|
137
|
+
export type ScansListByDataSourceParameters = RequestParameters;
|
|
138
|
+
export type ScanResultGetScanStatusParameters = RequestParameters;
|
|
139
|
+
export interface ScanResultRunScanQueryParamProperties {
|
|
140
|
+
/** The scan run id. */
|
|
141
|
+
runId: string;
|
|
142
|
+
/** The scan level. */
|
|
143
|
+
scanLevel?: "Full" | "Incremental";
|
|
144
|
+
}
|
|
145
|
+
export interface ScanResultRunScanQueryParam {
|
|
146
|
+
queryParameters: ScanResultRunScanQueryParamProperties;
|
|
147
|
+
}
|
|
148
|
+
export type ScanResultRunScanParameters = ScanResultRunScanQueryParam & RequestParameters;
|
|
149
|
+
export type ScanResultCancelScanParameters = RequestParameters;
|
|
150
|
+
export type ScanResultListScanHistoryParameters = RequestParameters;
|
|
151
|
+
export type ScanRulesetsGetParameters = RequestParameters;
|
|
152
|
+
export interface ScanRulesetsCreateOrReplaceBodyParam {
|
|
153
|
+
/** The scan rule set definition. */
|
|
154
|
+
body: ScanRuleset;
|
|
155
|
+
}
|
|
156
|
+
export interface ScanRulesetsCreateOrReplaceMediaTypesParam {
|
|
157
|
+
/** Request content type */
|
|
158
|
+
contentType?: "application/json";
|
|
159
|
+
}
|
|
160
|
+
export type ScanRulesetsCreateOrReplaceParameters = ScanRulesetsCreateOrReplaceMediaTypesParam & ScanRulesetsCreateOrReplaceBodyParam & RequestParameters;
|
|
161
|
+
export type ScanRulesetsDeleteParameters = RequestParameters;
|
|
162
|
+
export type ScanRulesetsListParameters = RequestParameters;
|
|
163
|
+
export type SystemScanRulesetsListParameters = RequestParameters;
|
|
164
|
+
export type SystemScanRulesetsGetParameters = RequestParameters;
|
|
165
|
+
export interface SystemScanRulesetsGetByVersionQueryParamProperties {
|
|
166
|
+
/** The data source type. */
|
|
167
|
+
dataSourceType?: "None" | "Fabric" | "AzureSubscription" | "AzureResourceGroup" | "AzureSynapseWorkspace" | "AzureSynapse" | "AdlsGen1" | "AdlsGen2" | "AmazonAccount" | "AmazonS3" | "AmazonSql" | "AzureCosmosDb" | "AzureDataExplorer" | "AzureFileService" | "AzureSqlDatabase" | "ArcEnabledSqlServer" | "AmazonPostgreSql" | "AzurePostgreSql" | "Databricks" | "SqlServerDatabase" | "AzureSqlDatabaseManagedInstance" | "AzureSqlDataWarehouse" | "AzureMySql" | "Hdfs" | "TableauServer" | "AzureStorage" | "Teradata" | "Oracle" | "PostgreSql" | "AmazonRedShift" | "DatabricksHms" | "SapS4Hana" | "SapEcc" | "Snowflake" | "PowerBI" | "Trident" | "Dataverse" | "DatabricksUnityCatalog";
|
|
168
|
+
}
|
|
169
|
+
export interface SystemScanRulesetsGetByVersionQueryParam {
|
|
170
|
+
queryParameters?: SystemScanRulesetsGetByVersionQueryParamProperties;
|
|
171
|
+
}
|
|
172
|
+
export type SystemScanRulesetsGetByVersionParameters = SystemScanRulesetsGetByVersionQueryParam & RequestParameters;
|
|
173
|
+
export interface SystemScanRulesetsGetLatestQueryParamProperties {
|
|
174
|
+
/** The data source type. */
|
|
175
|
+
dataSourceType?: "None" | "Fabric" | "AzureSubscription" | "AzureResourceGroup" | "AzureSynapseWorkspace" | "AzureSynapse" | "AdlsGen1" | "AdlsGen2" | "AmazonAccount" | "AmazonS3" | "AmazonSql" | "AzureCosmosDb" | "AzureDataExplorer" | "AzureFileService" | "AzureSqlDatabase" | "ArcEnabledSqlServer" | "AmazonPostgreSql" | "AzurePostgreSql" | "Databricks" | "SqlServerDatabase" | "AzureSqlDatabaseManagedInstance" | "AzureSqlDataWarehouse" | "AzureMySql" | "Hdfs" | "TableauServer" | "AzureStorage" | "Teradata" | "Oracle" | "PostgreSql" | "AmazonRedShift" | "DatabricksHms" | "SapS4Hana" | "SapEcc" | "Snowflake" | "PowerBI" | "Trident" | "Dataverse" | "DatabricksUnityCatalog";
|
|
176
|
+
}
|
|
177
|
+
export interface SystemScanRulesetsGetLatestQueryParam {
|
|
178
|
+
queryParameters?: SystemScanRulesetsGetLatestQueryParamProperties;
|
|
179
|
+
}
|
|
180
|
+
export type SystemScanRulesetsGetLatestParameters = SystemScanRulesetsGetLatestQueryParam & RequestParameters;
|
|
181
|
+
export interface SystemScanRulesetsListVersionsByDataSourceQueryParamProperties {
|
|
182
|
+
/** The data source type. */
|
|
183
|
+
dataSourceType?: "None" | "Fabric" | "AzureSubscription" | "AzureResourceGroup" | "AzureSynapseWorkspace" | "AzureSynapse" | "AdlsGen1" | "AdlsGen2" | "AmazonAccount" | "AmazonS3" | "AmazonSql" | "AzureCosmosDb" | "AzureDataExplorer" | "AzureFileService" | "AzureSqlDatabase" | "ArcEnabledSqlServer" | "AmazonPostgreSql" | "AzurePostgreSql" | "Databricks" | "SqlServerDatabase" | "AzureSqlDatabaseManagedInstance" | "AzureSqlDataWarehouse" | "AzureMySql" | "Hdfs" | "TableauServer" | "AzureStorage" | "Teradata" | "Oracle" | "PostgreSql" | "AmazonRedShift" | "DatabricksHms" | "SapS4Hana" | "SapEcc" | "Snowflake" | "PowerBI" | "Trident" | "Dataverse" | "DatabricksUnityCatalog";
|
|
184
|
+
}
|
|
185
|
+
export interface SystemScanRulesetsListVersionsByDataSourceQueryParam {
|
|
186
|
+
queryParameters?: SystemScanRulesetsListVersionsByDataSourceQueryParamProperties;
|
|
187
|
+
}
|
|
188
|
+
export type SystemScanRulesetsListVersionsByDataSourceParameters = SystemScanRulesetsListVersionsByDataSourceQueryParam & RequestParameters;
|
|
189
|
+
export type TriggersGetParameters = RequestParameters;
|
|
190
|
+
export interface TriggersCreateOrReplaceBodyParam {
|
|
191
|
+
/** The trigger definition. */
|
|
192
|
+
body: Trigger;
|
|
193
|
+
}
|
|
194
|
+
export interface TriggersCreateOrReplaceMediaTypesParam {
|
|
195
|
+
/** Request content type */
|
|
196
|
+
contentType?: "application/json";
|
|
197
|
+
}
|
|
198
|
+
export type TriggersCreateOrReplaceParameters = TriggersCreateOrReplaceMediaTypesParam & TriggersCreateOrReplaceBodyParam & RequestParameters;
|
|
199
|
+
export type TriggersDeleteParameters = RequestParameters;
|
|
200
|
+
export type TriggersEnableParameters = RequestParameters;
|
|
201
|
+
export type TriggersDisableParameters = RequestParameters;
|
|
202
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,MAAM,EACN,kBAAkB,EAClB,yCAAyC,EACzC,kDAAkD,EAClD,qBAAqB,EACrB,sBAAsB,EACtB,IAAI,EACJ,WAAW,EACX,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;AAEjE,MAAM,WAAW,2CAA2C;IAC1D,iDAAiD;IACjD,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,iDAAiD;IAChE,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,4CAA4C,GACtD,iDAAiD,GAC/C,2CAA2C,GAC3C,iBAAiB,CAAC;AACtB,MAAM,MAAM,mCAAmC,GAAG,iBAAiB,CAAC;AACpE,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;AAClE,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;AAEjE,MAAM,WAAW,2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,GACf,UAAU,GACV,WAAW,GACX,eAAe,GACf,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,GACnB,iCAAiC,GACjC,uBAAuB,GACvB,YAAY,GACZ,MAAM,GACN,eAAe,GACf,cAAc,GACd,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,GACT,SAAS,GACT,WAAW,GACX,wBAAwB,CAAC;CAC9B;AAED,MAAM,WAAW,oDAAoD;IACnE,eAAe,CAAC,EAAE,8DAA8D,CAAC;CAClF;AAED,MAAM,MAAM,oDAAoD,GAC9D,oDAAoD,GAAG,iBAAiB,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gCAAgC;IAC/C,8BAA8B;IAC9B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,sCAAsC;IACrD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,iCAAiC,GAAG,sCAAsC,GACpF,gCAAgC,GAChC,iBAAiB,CAAC;AACpB,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AACzD,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AACzD,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type {\n AzureKeyVault,\n ClassificationRule,\n Credential,\n DataSource,\n Filter,\n IntegrationRuntime,\n IntegrationRuntimeRegenerateKeyParameters,\n EnableInteractiveQueryForIntegrationRuntimeRequest,\n ManagedVirtualNetwork,\n ManagedPrivateEndpoint,\n Scan,\n ScanRuleset,\n Trigger,\n} from \"./models.js\";\n\nexport type KeyVaultConnectionsGetParameters = RequestParameters;\n\nexport interface KeyVaultConnectionsCreateOrReplaceBodyParam {\n /** The Azure Key Vault connection definition. */\n body: AzureKeyVault;\n}\n\nexport interface KeyVaultConnectionsCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type KeyVaultConnectionsCreateOrReplaceParameters =\n KeyVaultConnectionsCreateOrReplaceMediaTypesParam &\n KeyVaultConnectionsCreateOrReplaceBodyParam &\n RequestParameters;\nexport type KeyVaultConnectionsDeleteParameters = RequestParameters;\nexport type KeyVaultConnectionsListParameters = RequestParameters;\nexport type ClassificationRulesGetParameters = RequestParameters;\n\nexport interface ClassificationRulesCreateOrReplaceBodyParam {\n /** The classification rule definition. */\n body: ClassificationRule;\n}\n\nexport interface ClassificationRulesCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ClassificationRulesCreateOrReplaceParameters =\n ClassificationRulesCreateOrReplaceMediaTypesParam &\n ClassificationRulesCreateOrReplaceBodyParam &\n RequestParameters;\nexport type ClassificationRulesDeleteParameters = RequestParameters;\nexport type ClassificationRulesListParameters = RequestParameters;\nexport type ClassificationRulesListVersionsByRuleNameParameters = RequestParameters;\n\nexport interface ClassificationRulesTagClassificationVersionQueryParamProperties {\n /** The action of classification rule. */\n action: \"Keep\" | \"Delete\";\n}\n\nexport interface ClassificationRulesTagClassificationVersionQueryParam {\n queryParameters: ClassificationRulesTagClassificationVersionQueryParamProperties;\n}\n\nexport type ClassificationRulesTagClassificationVersionParameters =\n ClassificationRulesTagClassificationVersionQueryParam & RequestParameters;\nexport type CredentialGetParameters = RequestParameters;\n\nexport interface CredentialCreateOrReplaceBodyParam {\n /** The credential definition. */\n body: Credential;\n}\n\nexport interface CredentialCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type CredentialCreateOrReplaceParameters = CredentialCreateOrReplaceMediaTypesParam &\n CredentialCreateOrReplaceBodyParam &\n RequestParameters;\nexport type CredentialDeleteParameters = RequestParameters;\nexport type CredentialListParameters = RequestParameters;\n\nexport interface DataSourcesCreateOrReplaceBodyParam {\n /** The data source definition. */\n body: DataSource;\n}\n\nexport interface DataSourcesCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DataSourcesCreateOrReplaceParameters = DataSourcesCreateOrReplaceMediaTypesParam &\n DataSourcesCreateOrReplaceBodyParam &\n RequestParameters;\nexport type DataSourcesGetParameters = RequestParameters;\nexport type DataSourcesDeleteParameters = RequestParameters;\nexport type DataSourcesListParameters = RequestParameters;\nexport type FiltersGetParameters = RequestParameters;\n\nexport interface FiltersCreateOrReplaceBodyParam {\n /** The filter definition. */\n body: Filter;\n}\n\nexport interface FiltersCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type FiltersCreateOrReplaceParameters = FiltersCreateOrReplaceMediaTypesParam &\n FiltersCreateOrReplaceBodyParam &\n RequestParameters;\nexport type IntegrationRuntimesListByAccountParameters = RequestParameters;\nexport type IntegrationRuntimesGetParameters = RequestParameters;\nexport type IntegrationRuntimesDeleteParameters = RequestParameters;\n\nexport interface IntegrationRuntimesCreateOrReplaceBodyParam {\n /** The integration runtime definition. */\n body: IntegrationRuntime;\n}\n\nexport interface IntegrationRuntimesCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type IntegrationRuntimesCreateOrReplaceParameters =\n IntegrationRuntimesCreateOrReplaceMediaTypesParam &\n IntegrationRuntimesCreateOrReplaceBodyParam &\n RequestParameters;\nexport type IntegrationRuntimesStatusParameters = RequestParameters;\nexport type IntegrationRuntimesListAuthKeysParameters = RequestParameters;\n\nexport interface IntegrationRuntimesRegenerateAuthKeyBodyParam {\n /** The request of regenerating authentication key of an integration runtime. */\n body: IntegrationRuntimeRegenerateKeyParameters;\n}\n\nexport interface IntegrationRuntimesRegenerateAuthKeyMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type IntegrationRuntimesRegenerateAuthKeyParameters =\n IntegrationRuntimesRegenerateAuthKeyMediaTypesParam &\n IntegrationRuntimesRegenerateAuthKeyBodyParam &\n RequestParameters;\nexport type IntegrationRuntimesDisableInteractiveQueryParameters = RequestParameters;\n\nexport interface IntegrationRuntimesEnableInteractiveQueryBodyParam {\n /** The request of enabling interactive query for integration runtime. */\n body: EnableInteractiveQueryForIntegrationRuntimeRequest;\n}\n\nexport interface IntegrationRuntimesEnableInteractiveQueryMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type IntegrationRuntimesEnableInteractiveQueryParameters =\n IntegrationRuntimesEnableInteractiveQueryMediaTypesParam &\n IntegrationRuntimesEnableInteractiveQueryBodyParam &\n RequestParameters;\nexport type ManagedVirtualNetworksListByAccountParameters = RequestParameters;\nexport type ManagedVirtualNetworksGetParameters = RequestParameters;\n\nexport interface ManagedVirtualNetworksCreateOrReplaceBodyParam {\n /** The managed virtual network resource definition. */\n body: ManagedVirtualNetwork;\n}\n\nexport interface ManagedVirtualNetworksCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ManagedVirtualNetworksCreateOrReplaceParameters =\n ManagedVirtualNetworksCreateOrReplaceMediaTypesParam &\n ManagedVirtualNetworksCreateOrReplaceBodyParam &\n RequestParameters;\nexport type ManagedPrivateEndpointsListByAccountParameters = RequestParameters;\nexport type ManagedPrivateEndpointsGetParameters = RequestParameters;\nexport type ManagedPrivateEndpointsDeleteParameters = RequestParameters;\n\nexport interface ManagedPrivateEndpointsCreateOrReplaceBodyParam {\n /** The managed private endpoint resource definition. */\n body: ManagedPrivateEndpoint;\n}\n\nexport interface ManagedPrivateEndpointsCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ManagedPrivateEndpointsCreateOrReplaceParameters =\n ManagedPrivateEndpointsCreateOrReplaceMediaTypesParam &\n ManagedPrivateEndpointsCreateOrReplaceBodyParam &\n RequestParameters;\n\nexport interface ScansCreateOrReplaceBodyParam {\n /** The scan definition. */\n body: Scan;\n}\n\nexport interface ScansCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ScansCreateOrReplaceParameters = ScansCreateOrReplaceMediaTypesParam &\n ScansCreateOrReplaceBodyParam &\n RequestParameters;\nexport type ScansGetParameters = RequestParameters;\nexport type ScansDeleteParameters = RequestParameters;\nexport type ScansListByDataSourceParameters = RequestParameters;\nexport type ScanResultGetScanStatusParameters = RequestParameters;\n\nexport interface ScanResultRunScanQueryParamProperties {\n /** The scan run id. */\n runId: string;\n /** The scan level. */\n scanLevel?: \"Full\" | \"Incremental\";\n}\n\nexport interface ScanResultRunScanQueryParam {\n queryParameters: ScanResultRunScanQueryParamProperties;\n}\n\nexport type ScanResultRunScanParameters = ScanResultRunScanQueryParam & RequestParameters;\nexport type ScanResultCancelScanParameters = RequestParameters;\nexport type ScanResultListScanHistoryParameters = RequestParameters;\nexport type ScanRulesetsGetParameters = RequestParameters;\n\nexport interface ScanRulesetsCreateOrReplaceBodyParam {\n /** The scan rule set definition. */\n body: ScanRuleset;\n}\n\nexport interface ScanRulesetsCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ScanRulesetsCreateOrReplaceParameters = ScanRulesetsCreateOrReplaceMediaTypesParam &\n ScanRulesetsCreateOrReplaceBodyParam &\n RequestParameters;\nexport type ScanRulesetsDeleteParameters = RequestParameters;\nexport type ScanRulesetsListParameters = RequestParameters;\nexport type SystemScanRulesetsListParameters = RequestParameters;\nexport type SystemScanRulesetsGetParameters = RequestParameters;\n\nexport interface SystemScanRulesetsGetByVersionQueryParamProperties {\n /** The data source type. */\n dataSourceType?:\n | \"None\"\n | \"Fabric\"\n | \"AzureSubscription\"\n | \"AzureResourceGroup\"\n | \"AzureSynapseWorkspace\"\n | \"AzureSynapse\"\n | \"AdlsGen1\"\n | \"AdlsGen2\"\n | \"AmazonAccount\"\n | \"AmazonS3\"\n | \"AmazonSql\"\n | \"AzureCosmosDb\"\n | \"AzureDataExplorer\"\n | \"AzureFileService\"\n | \"AzureSqlDatabase\"\n | \"ArcEnabledSqlServer\"\n | \"AmazonPostgreSql\"\n | \"AzurePostgreSql\"\n | \"Databricks\"\n | \"SqlServerDatabase\"\n | \"AzureSqlDatabaseManagedInstance\"\n | \"AzureSqlDataWarehouse\"\n | \"AzureMySql\"\n | \"Hdfs\"\n | \"TableauServer\"\n | \"AzureStorage\"\n | \"Teradata\"\n | \"Oracle\"\n | \"PostgreSql\"\n | \"AmazonRedShift\"\n | \"DatabricksHms\"\n | \"SapS4Hana\"\n | \"SapEcc\"\n | \"Snowflake\"\n | \"PowerBI\"\n | \"Trident\"\n | \"Dataverse\"\n | \"DatabricksUnityCatalog\";\n}\n\nexport interface SystemScanRulesetsGetByVersionQueryParam {\n queryParameters?: SystemScanRulesetsGetByVersionQueryParamProperties;\n}\n\nexport type SystemScanRulesetsGetByVersionParameters = SystemScanRulesetsGetByVersionQueryParam &\n RequestParameters;\n\nexport interface SystemScanRulesetsGetLatestQueryParamProperties {\n /** The data source type. */\n dataSourceType?:\n | \"None\"\n | \"Fabric\"\n | \"AzureSubscription\"\n | \"AzureResourceGroup\"\n | \"AzureSynapseWorkspace\"\n | \"AzureSynapse\"\n | \"AdlsGen1\"\n | \"AdlsGen2\"\n | \"AmazonAccount\"\n | \"AmazonS3\"\n | \"AmazonSql\"\n | \"AzureCosmosDb\"\n | \"AzureDataExplorer\"\n | \"AzureFileService\"\n | \"AzureSqlDatabase\"\n | \"ArcEnabledSqlServer\"\n | \"AmazonPostgreSql\"\n | \"AzurePostgreSql\"\n | \"Databricks\"\n | \"SqlServerDatabase\"\n | \"AzureSqlDatabaseManagedInstance\"\n | \"AzureSqlDataWarehouse\"\n | \"AzureMySql\"\n | \"Hdfs\"\n | \"TableauServer\"\n | \"AzureStorage\"\n | \"Teradata\"\n | \"Oracle\"\n | \"PostgreSql\"\n | \"AmazonRedShift\"\n | \"DatabricksHms\"\n | \"SapS4Hana\"\n | \"SapEcc\"\n | \"Snowflake\"\n | \"PowerBI\"\n | \"Trident\"\n | \"Dataverse\"\n | \"DatabricksUnityCatalog\";\n}\n\nexport interface SystemScanRulesetsGetLatestQueryParam {\n queryParameters?: SystemScanRulesetsGetLatestQueryParamProperties;\n}\n\nexport type SystemScanRulesetsGetLatestParameters = SystemScanRulesetsGetLatestQueryParam &\n RequestParameters;\n\nexport interface SystemScanRulesetsListVersionsByDataSourceQueryParamProperties {\n /** The data source type. */\n dataSourceType?:\n | \"None\"\n | \"Fabric\"\n | \"AzureSubscription\"\n | \"AzureResourceGroup\"\n | \"AzureSynapseWorkspace\"\n | \"AzureSynapse\"\n | \"AdlsGen1\"\n | \"AdlsGen2\"\n | \"AmazonAccount\"\n | \"AmazonS3\"\n | \"AmazonSql\"\n | \"AzureCosmosDb\"\n | \"AzureDataExplorer\"\n | \"AzureFileService\"\n | \"AzureSqlDatabase\"\n | \"ArcEnabledSqlServer\"\n | \"AmazonPostgreSql\"\n | \"AzurePostgreSql\"\n | \"Databricks\"\n | \"SqlServerDatabase\"\n | \"AzureSqlDatabaseManagedInstance\"\n | \"AzureSqlDataWarehouse\"\n | \"AzureMySql\"\n | \"Hdfs\"\n | \"TableauServer\"\n | \"AzureStorage\"\n | \"Teradata\"\n | \"Oracle\"\n | \"PostgreSql\"\n | \"AmazonRedShift\"\n | \"DatabricksHms\"\n | \"SapS4Hana\"\n | \"SapEcc\"\n | \"Snowflake\"\n | \"PowerBI\"\n | \"Trident\"\n | \"Dataverse\"\n | \"DatabricksUnityCatalog\";\n}\n\nexport interface SystemScanRulesetsListVersionsByDataSourceQueryParam {\n queryParameters?: SystemScanRulesetsListVersionsByDataSourceQueryParamProperties;\n}\n\nexport type SystemScanRulesetsListVersionsByDataSourceParameters =\n SystemScanRulesetsListVersionsByDataSourceQueryParam & RequestParameters;\nexport type TriggersGetParameters = RequestParameters;\n\nexport interface TriggersCreateOrReplaceBodyParam {\n /** The trigger definition. */\n body: Trigger;\n}\n\nexport interface TriggersCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type TriggersCreateOrReplaceParameters = TriggersCreateOrReplaceMediaTypesParam &\n TriggersCreateOrReplaceBodyParam &\n RequestParameters;\nexport type TriggersDeleteParameters = RequestParameters;\nexport type TriggersEnableParameters = RequestParameters;\nexport type TriggersDisableParameters = RequestParameters;\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Client, HttpResponse } from "@azure-rest/core-client";
|
|
2
|
+
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
3
|
+
import type { CancelOnProgress, CreateHttpPollerOptions, OperationState } from "@azure/core-lro";
|
|
4
|
+
/**
|
|
5
|
+
* A simple poller that can be used to poll a long running operation.
|
|
6
|
+
*/
|
|
7
|
+
export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if the poller has finished polling.
|
|
10
|
+
*/
|
|
11
|
+
isDone(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the state of the operation.
|
|
14
|
+
*/
|
|
15
|
+
getOperationState(): TState;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the result value of the operation,
|
|
18
|
+
* regardless of the state of the poller.
|
|
19
|
+
* It can return undefined or an incomplete form of the final TResult value
|
|
20
|
+
* depending on the implementation.
|
|
21
|
+
*/
|
|
22
|
+
getResult(): TResult | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a promise that will resolve once a single polling request finishes.
|
|
25
|
+
* It does this by calling the update method of the Poller's operation.
|
|
26
|
+
*/
|
|
27
|
+
poll(options?: {
|
|
28
|
+
abortSignal?: AbortSignalLike;
|
|
29
|
+
}): Promise<TState>;
|
|
30
|
+
/**
|
|
31
|
+
* Returns a promise that will resolve once the underlying operation is completed.
|
|
32
|
+
*/
|
|
33
|
+
pollUntilDone(pollOptions?: {
|
|
34
|
+
abortSignal?: AbortSignalLike;
|
|
35
|
+
}): Promise<TResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Invokes the provided callback after each polling is completed,
|
|
38
|
+
* sending the current state of the poller's operation.
|
|
39
|
+
*
|
|
40
|
+
* It returns a method that can be used to stop receiving updates on the given callback function.
|
|
41
|
+
*/
|
|
42
|
+
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
|
43
|
+
/**
|
|
44
|
+
* Returns a promise that could be used for serialized version of the poller's operation
|
|
45
|
+
* by invoking the operation's serialize method.
|
|
46
|
+
*/
|
|
47
|
+
serialize(): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Wait the poller to be submitted.
|
|
50
|
+
*/
|
|
51
|
+
submitted(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a string representation of the poller's operation. Similar to serialize but returns a string.
|
|
54
|
+
* @deprecated Use serialize() instead.
|
|
55
|
+
*/
|
|
56
|
+
toString(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Stops the poller from continuing to poll. Please note this will only stop the client-side polling
|
|
59
|
+
* @deprecated Use abortSignal to stop polling instead.
|
|
60
|
+
*/
|
|
61
|
+
stopPolling(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Returns true if the poller is stopped.
|
|
64
|
+
* @deprecated Use abortSignal status to track this instead.
|
|
65
|
+
*/
|
|
66
|
+
isStopped(): boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Helper function that builds a Poller object to help polling a long running operation.
|
|
70
|
+
* @param client - Client to use for sending the request to get additional pages.
|
|
71
|
+
* @param initialResponse - The initial response.
|
|
72
|
+
* @param options - Options to set a resume state or custom polling interval.
|
|
73
|
+
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
74
|
+
*/
|
|
75
|
+
export declare function getLongRunningPoller<TResult extends HttpResponse>(client: Client, initialResponse: TResult, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
|
|
76
|
+
//# sourceMappingURL=pollingHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingHelper.d.ts","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EAGvB,cAAc,EACf,MAAM,iBAAiB,CAAC;AAGzB;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,MAAM,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO;IAC/E;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC;IAClB;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,eAAe,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnE;;OAEG;IACH,aAAa,CAAC,WAAW,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,eAAe,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACjF;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,gBAAgB,CAAC;IAEhE;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B;;;OAGG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;;OAGG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,SAAS,YAAY,EACrE,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,OAAO,EACxB,OAAO,GAAE,uBAAuB,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAM,GACtE,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAgF7D"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createHttpPoller } from "@azure/core-lro";
|
|
4
|
+
/**
|
|
5
|
+
* Helper function that builds a Poller object to help polling a long running operation.
|
|
6
|
+
* @param client - Client to use for sending the request to get additional pages.
|
|
7
|
+
* @param initialResponse - The initial response.
|
|
8
|
+
* @param options - Options to set a resume state or custom polling interval.
|
|
9
|
+
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
10
|
+
*/
|
|
11
|
+
export async function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
12
|
+
const abortController = new AbortController();
|
|
13
|
+
const poller = {
|
|
14
|
+
sendInitialRequest: async () => {
|
|
15
|
+
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
|
|
16
|
+
// we are not triggering the initial request here, just extracting the information from the
|
|
17
|
+
// response we were provided.
|
|
18
|
+
return getLroResponse(initialResponse);
|
|
19
|
+
},
|
|
20
|
+
sendPollRequest: async (path, pollOptions) => {
|
|
21
|
+
// This is the callback that is going to be called to poll the service
|
|
22
|
+
// to get the latest status. We use the client provided and the polling path
|
|
23
|
+
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
24
|
+
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
25
|
+
function abortListener() {
|
|
26
|
+
abortController.abort();
|
|
27
|
+
}
|
|
28
|
+
const inputAbortSignal = pollOptions?.abortSignal;
|
|
29
|
+
const abortSignal = abortController.signal;
|
|
30
|
+
if (inputAbortSignal?.aborted) {
|
|
31
|
+
abortController.abort();
|
|
32
|
+
}
|
|
33
|
+
else if (!abortSignal.aborted) {
|
|
34
|
+
inputAbortSignal?.addEventListener("abort", abortListener, {
|
|
35
|
+
once: true,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
let response;
|
|
39
|
+
try {
|
|
40
|
+
response = await client
|
|
41
|
+
.pathUnchecked(path ?? initialResponse.request.url)
|
|
42
|
+
.get({ abortSignal });
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
inputAbortSignal?.removeEventListener("abort", abortListener);
|
|
46
|
+
}
|
|
47
|
+
const lroResponse = getLroResponse(response);
|
|
48
|
+
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
49
|
+
return lroResponse;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;
|
|
53
|
+
const httpPoller = createHttpPoller(poller, options);
|
|
54
|
+
const simplePoller = {
|
|
55
|
+
isDone() {
|
|
56
|
+
return httpPoller.isDone;
|
|
57
|
+
},
|
|
58
|
+
isStopped() {
|
|
59
|
+
return abortController.signal.aborted;
|
|
60
|
+
},
|
|
61
|
+
getOperationState() {
|
|
62
|
+
if (!httpPoller.operationState) {
|
|
63
|
+
throw new Error("Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().");
|
|
64
|
+
}
|
|
65
|
+
return httpPoller.operationState;
|
|
66
|
+
},
|
|
67
|
+
getResult() {
|
|
68
|
+
return httpPoller.result;
|
|
69
|
+
},
|
|
70
|
+
toString() {
|
|
71
|
+
if (!httpPoller.operationState) {
|
|
72
|
+
throw new Error("Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().");
|
|
73
|
+
}
|
|
74
|
+
return JSON.stringify({
|
|
75
|
+
state: httpPoller.operationState,
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
stopPolling() {
|
|
79
|
+
abortController.abort();
|
|
80
|
+
},
|
|
81
|
+
onProgress: httpPoller.onProgress,
|
|
82
|
+
poll: httpPoller.poll,
|
|
83
|
+
pollUntilDone: httpPoller.pollUntilDone,
|
|
84
|
+
serialize: httpPoller.serialize,
|
|
85
|
+
submitted: httpPoller.submitted,
|
|
86
|
+
};
|
|
87
|
+
return simplePoller;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
91
|
+
* @param response - a rest client http response
|
|
92
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
93
|
+
*/
|
|
94
|
+
function getLroResponse(response) {
|
|
95
|
+
if (Number.isNaN(response.status)) {
|
|
96
|
+
throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
flatResponse: response,
|
|
100
|
+
rawResponse: {
|
|
101
|
+
...response,
|
|
102
|
+
statusCode: Number.parseInt(response.status),
|
|
103
|
+
body: response.body,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=pollingHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAoEnD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,eAAwB,EACxB,UAAqE,EAAE;IAEvE,MAAM,eAAe,GAAG,IAA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G,CAAC;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,EAAE;YACX,GAAG,QAAQ;YACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n CancelOnProgress,\n CreateHttpPollerOptions,\n RunningOperation,\n OperationResponse,\n OperationState,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a promise that could be used for serialized version of the poller's operation\n * by invoking the operation's serialize method.\n */\n serialize(): Promise<string>;\n\n /**\n * Wait the poller to be submitted.\n */\n submitted(): Promise<void>;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n * @deprecated Use serialize() instead.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n * @deprecated Use abortSignal to stop polling instead.\n */\n stopPolling(): void;\n\n /**\n * Returns true if the poller is stopped.\n * @deprecated Use abortSignal status to track this instead.\n */\n isStopped(): boolean;\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {},\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;\n const httpPoller = createHttpPoller(poller, options);\n const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return httpPoller.operationState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState,\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n poll: httpPoller.poll,\n pollUntilDone: httpPoller.pollUntilDone,\n serialize: httpPoller.serialize,\n submitted: httpPoller.submitted,\n };\n return simplePoller;\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult,\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { PurviewScanningRestClient } from "./clientDefinitions.js";
|
|
4
|
+
/** The optional parameters for the client */
|
|
5
|
+
export interface PurviewScanningRestClientOptions extends ClientOptions {
|
|
6
|
+
/** The api version option of the client */
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Initialize a new instance of `PurviewScanningRestClient`
|
|
11
|
+
* @param endpoint - The scanning endpoint of your purview account. Example: https://{accountName}.purview.azure.com.
|
|
12
|
+
* @param credentials - uniquely identify client credential
|
|
13
|
+
* @param options - the parameter for all optional parameters
|
|
14
|
+
*/
|
|
15
|
+
export default function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: PurviewScanningRestClientOptions): PurviewScanningRestClient;
|
|
16
|
+
//# sourceMappingURL=purviewScanningRestClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purviewScanningRestClient.d.ts","sourceRoot":"","sources":["../../src/purviewScanningRestClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,6CAA6C;AAC7C,MAAM,WAAW,gCAAiC,SAAQ,aAAa;IACrE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,gCAAqC,GAC/E,yBAAyB,CAuC3B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { getClient } from "@azure-rest/core-client";
|
|
4
|
+
import { logger } from "./logger.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialize a new instance of `PurviewScanningRestClient`
|
|
7
|
+
* @param endpoint - The scanning endpoint of your purview account. Example: https://{accountName}.purview.azure.com.
|
|
8
|
+
* @param credentials - uniquely identify client credential
|
|
9
|
+
* @param options - the parameter for all optional parameters
|
|
10
|
+
*/
|
|
11
|
+
export default function createClient(endpoint, credentials, { apiVersion = "2023-09-01", ...options } = {}) {
|
|
12
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/scan`;
|
|
13
|
+
const userAgentInfo = `azsdk-js-purview-scanning-rest/1.0.0-beta.3`;
|
|
14
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
15
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
16
|
+
: `${userAgentInfo}`;
|
|
17
|
+
options = {
|
|
18
|
+
...options,
|
|
19
|
+
userAgentOptions: {
|
|
20
|
+
userAgentPrefix,
|
|
21
|
+
},
|
|
22
|
+
loggingOptions: {
|
|
23
|
+
logger: options.loggingOptions?.logger ?? logger.info,
|
|
24
|
+
},
|
|
25
|
+
credentials: {
|
|
26
|
+
scopes: options.credentials?.scopes ?? ["https://purview.azure.net/.default"],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const client = getClient(endpointUrl, credentials, options);
|
|
30
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
31
|
+
client.pipeline.addPolicy({
|
|
32
|
+
name: "ClientApiVersionPolicy",
|
|
33
|
+
sendRequest: (req, next) => {
|
|
34
|
+
// Use the apiVersion defined in request url directly
|
|
35
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
36
|
+
const url = new URL(req.url);
|
|
37
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
38
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
39
|
+
}
|
|
40
|
+
return next(req);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return client;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=purviewScanningRestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purviewScanningRestClient.js","sourceRoot":"","sources":["../../src/purviewScanningRestClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE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YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewScanningRestClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface PurviewScanningRestClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `PurviewScanningRestClient`\n * @param endpoint - The scanning endpoint of your purview account. Example: https://{accountName}.purview.azure.com.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2023-09-01\", ...options }: PurviewScanningRestClientOptions = {},\n): PurviewScanningRestClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/scan`;\n const userAgentInfo = `azsdk-js-purview-scanning-rest/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://purview.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as PurviewScanningRestClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|