@azure/arm-resourcegraph 4.0.0 → 5.0.0-beta.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 +11 -0
- package/LICENSE +21 -0
- package/README.md +70 -70
- package/dist/index.js +933 -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/accessAPropertiesField.d.ts +2 -0
- package/dist-esm/samples-dev/accessAPropertiesField.d.ts.map +1 -0
- package/dist-esm/samples-dev/accessAPropertiesField.js +32 -0
- package/dist-esm/samples-dev/accessAPropertiesField.js.map +1 -0
- package/dist-esm/samples-dev/basicManagementGroupQuery.d.ts +2 -0
- package/dist-esm/samples-dev/basicManagementGroupQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/basicManagementGroupQuery.js +32 -0
- package/dist-esm/samples-dev/basicManagementGroupQuery.js.map +1 -0
- package/dist-esm/samples-dev/basicQuery.d.ts +2 -0
- package/dist-esm/samples-dev/basicQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/basicQuery.js +32 -0
- package/dist-esm/samples-dev/basicQuery.js.map +1 -0
- package/dist-esm/samples-dev/basicTenantQuery.d.ts +2 -0
- package/dist-esm/samples-dev/basicTenantQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/basicTenantQuery.js +31 -0
- package/dist-esm/samples-dev/basicTenantQuery.js.map +1 -0
- package/dist-esm/samples-dev/complexQuery.d.ts +2 -0
- package/dist-esm/samples-dev/complexQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/complexQuery.js +32 -0
- package/dist-esm/samples-dev/complexQuery.js.map +1 -0
- package/dist-esm/samples-dev/filterResources.d.ts +2 -0
- package/dist-esm/samples-dev/filterResources.d.ts.map +1 -0
- package/dist-esm/samples-dev/filterResources.js +32 -0
- package/dist-esm/samples-dev/filterResources.js.map +1 -0
- package/dist-esm/samples-dev/firstPageQuery.d.ts +2 -0
- package/dist-esm/samples-dev/firstPageQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/firstPageQuery.js +33 -0
- package/dist-esm/samples-dev/firstPageQuery.js.map +1 -0
- package/dist-esm/samples-dev/nextPageQuery.d.ts +2 -0
- package/dist-esm/samples-dev/nextPageQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/nextPageQuery.js +35 -0
- package/dist-esm/samples-dev/nextPageQuery.js.map +1 -0
- package/dist-esm/samples-dev/operationsList.d.ts +2 -0
- package/dist-esm/samples-dev/operationsList.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsList.js +42 -0
- package/dist-esm/samples-dev/operationsList.js.map +1 -0
- package/dist-esm/samples-dev/queryWithAFacetRequest.d.ts +2 -0
- package/dist-esm/samples-dev/queryWithAFacetRequest.d.ts.map +1 -0
- package/dist-esm/samples-dev/queryWithAFacetRequest.js +51 -0
- package/dist-esm/samples-dev/queryWithAFacetRequest.js.map +1 -0
- package/dist-esm/samples-dev/randomPageQuery.d.ts +2 -0
- package/dist-esm/samples-dev/randomPageQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/randomPageQuery.js +33 -0
- package/dist-esm/samples-dev/randomPageQuery.js.map +1 -0
- package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.d.ts +2 -0
- package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.js +38 -0
- package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.js.map +1 -0
- package/dist-esm/samples-dev/resourceHistoryQuery.d.ts +2 -0
- package/dist-esm/samples-dev/resourceHistoryQuery.d.ts.map +1 -0
- package/dist-esm/samples-dev/resourceHistoryQuery.js +38 -0
- package/dist-esm/samples-dev/resourceHistoryQuery.js.map +1 -0
- package/dist-esm/samples-dev/summarizeResourcesByLocation.d.ts +2 -0
- package/dist-esm/samples-dev/summarizeResourcesByLocation.d.ts.map +1 -0
- package/dist-esm/samples-dev/summarizeResourcesByLocation.js +32 -0
- package/dist-esm/samples-dev/summarizeResourcesByLocation.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/models/index.d.ts +216 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/{src/models/operationsMappers.ts → dist-esm/src/models/index.js} +2 -10
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +26 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +353 -267
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +8 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +61 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +1 -2
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +26 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +90 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +2 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/index.js} +2 -2
- 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/resourceGraphClient.d.ts +28 -0
- package/dist-esm/src/resourceGraphClient.d.ts.map +1 -0
- package/dist-esm/src/resourceGraphClient.js +103 -0
- package/dist-esm/src/resourceGraphClient.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 +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +75 -32
- package/review/arm-resourcegraph.api.md +214 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +12 -0
- package/src/models/index.ts +192 -341
- package/src/models/mappers.ts +353 -265
- package/src/models/parameters.ts +53 -9
- package/src/operations/index.ts +1 -2
- package/src/operations/operations.ts +64 -39
- package/{esm/models/index.js → src/operationsInterfaces/index.ts} +2 -1
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/resourceGraphClient.ts +111 -59
- package/tsconfig.json +5 -4
- package/types/arm-resourcegraph.d.ts +284 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-resourcegraph.js +0 -860
- package/dist/arm-resourcegraph.js.map +0 -1
- package/dist/arm-resourcegraph.min.js +0 -1
- package/dist/arm-resourcegraph.min.js.map +0 -1
- package/esm/models/index.d.ts +0 -375
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -25
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -4
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -29
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -28
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -50
- package/esm/operations/operations.js.map +0 -1
- package/esm/resourceGraphClient.d.ts +0 -35
- package/esm/resourceGraphClient.d.ts.map +0 -1
- package/esm/resourceGraphClient.js +0 -63
- package/esm/resourceGraphClient.js.map +0 -1
- package/esm/resourceGraphClientContext.d.ts +0 -14
- package/esm/resourceGraphClientContext.d.ts.map +0 -1
- package/esm/resourceGraphClientContext.js +0 -50
- package/esm/resourceGraphClientContext.js.map +0 -1
- package/src/resourceGraphClientContext.ts +0 -55
package/src/models/parameters.ts
CHANGED
|
@@ -3,29 +3,73 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
7
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
OperationParameter,
|
|
11
|
+
OperationURLParameter,
|
|
12
|
+
OperationQueryParameter
|
|
13
|
+
} from "@azure/core-client";
|
|
14
|
+
import {
|
|
15
|
+
QueryRequest as QueryRequestMapper,
|
|
16
|
+
ResourcesHistoryRequest as ResourcesHistoryRequestMapper
|
|
17
|
+
} from "../models/mappers";
|
|
11
18
|
|
|
12
|
-
export const
|
|
13
|
-
parameterPath: "
|
|
19
|
+
export const contentType: OperationParameter = {
|
|
20
|
+
parameterPath: ["options", "contentType"],
|
|
14
21
|
mapper: {
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
defaultValue: "application/json",
|
|
23
|
+
isConstant: true,
|
|
24
|
+
serializedName: "Content-Type",
|
|
17
25
|
type: {
|
|
18
26
|
name: "String"
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
};
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
|
|
31
|
+
export const query: OperationParameter = {
|
|
32
|
+
parameterPath: "query",
|
|
33
|
+
mapper: QueryRequestMapper
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const accept: OperationParameter = {
|
|
37
|
+
parameterPath: "accept",
|
|
38
|
+
mapper: {
|
|
39
|
+
defaultValue: "application/json",
|
|
40
|
+
isConstant: true,
|
|
41
|
+
serializedName: "Accept",
|
|
42
|
+
type: {
|
|
43
|
+
name: "String"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const $host: OperationURLParameter = {
|
|
49
|
+
parameterPath: "$host",
|
|
24
50
|
mapper: {
|
|
51
|
+
serializedName: "$host",
|
|
25
52
|
required: true,
|
|
53
|
+
type: {
|
|
54
|
+
name: "String"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
skipEncoding: true
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const apiVersion: OperationQueryParameter = {
|
|
61
|
+
parameterPath: "apiVersion",
|
|
62
|
+
mapper: {
|
|
63
|
+
defaultValue: "2021-06-01-preview",
|
|
64
|
+
isConstant: true,
|
|
26
65
|
serializedName: "api-version",
|
|
27
66
|
type: {
|
|
28
67
|
name: "String"
|
|
29
68
|
}
|
|
30
69
|
}
|
|
31
70
|
};
|
|
71
|
+
|
|
72
|
+
export const request: OperationParameter = {
|
|
73
|
+
parameterPath: "request",
|
|
74
|
+
mapper: ResourcesHistoryRequestMapper
|
|
75
|
+
};
|
package/src/operations/index.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
7
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
export * from "./operations";
|
|
@@ -3,64 +3,86 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
7
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import * as
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { Operations } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { ResourceGraphClient } from "../resourceGraphClient";
|
|
15
|
+
import {
|
|
16
|
+
Operation,
|
|
17
|
+
OperationsListOptionalParams,
|
|
18
|
+
OperationsListResponse
|
|
19
|
+
} from "../models";
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
/// <reference lib="esnext.asynciterable" />
|
|
22
|
+
/** Class containing Operations operations. */
|
|
23
|
+
export class OperationsImpl implements Operations {
|
|
24
|
+
private readonly client: ResourceGraphClient;
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param
|
|
27
|
+
* Initialize a new instance of the class Operations class.
|
|
28
|
+
* @param client Reference to the service client
|
|
23
29
|
*/
|
|
24
|
-
constructor(client:
|
|
30
|
+
constructor(client: ResourceGraphClient) {
|
|
25
31
|
this.client = client;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
/**
|
|
29
35
|
* Lists all of the available REST API operations.
|
|
30
|
-
* @param
|
|
31
|
-
* @returns Promise<Models.OperationsListResponse>
|
|
36
|
+
* @param options The options parameters.
|
|
32
37
|
*/
|
|
33
|
-
list(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
public list(
|
|
39
|
+
options?: OperationsListOptionalParams
|
|
40
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
41
|
+
const iter = this.listPagingAll(options);
|
|
42
|
+
return {
|
|
43
|
+
next() {
|
|
44
|
+
return iter.next();
|
|
45
|
+
},
|
|
46
|
+
[Symbol.asyncIterator]() {
|
|
47
|
+
return this;
|
|
48
|
+
},
|
|
49
|
+
byPage: () => {
|
|
50
|
+
return this.listPagingPage(options);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private async *listPagingPage(
|
|
56
|
+
options?: OperationsListOptionalParams
|
|
57
|
+
): AsyncIterableIterator<Operation[]> {
|
|
58
|
+
let result = await this._list(options);
|
|
59
|
+
yield result.value || [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async *listPagingAll(
|
|
63
|
+
options?: OperationsListOptionalParams
|
|
64
|
+
): AsyncIterableIterator<Operation> {
|
|
65
|
+
for await (const page of this.listPagingPage(options)) {
|
|
66
|
+
yield* page;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
38
70
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @param
|
|
71
|
+
* Lists all of the available REST API operations.
|
|
72
|
+
* @param options The options parameters.
|
|
41
73
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
options
|
|
47
|
-
},
|
|
48
|
-
listOperationSpec,
|
|
49
|
-
callback) as Promise<Models.OperationsListResponse>;
|
|
74
|
+
private _list(
|
|
75
|
+
options?: OperationsListOptionalParams
|
|
76
|
+
): Promise<OperationsListResponse> {
|
|
77
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
50
78
|
}
|
|
51
79
|
}
|
|
52
|
-
|
|
53
80
|
// Operation Specifications
|
|
54
|
-
const serializer =
|
|
55
|
-
|
|
81
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
82
|
+
|
|
83
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
84
|
+
path: "/providers/Microsoft.ResourceGraph/operations",
|
|
56
85
|
httpMethod: "GET",
|
|
57
|
-
path: "providers/Microsoft.ResourceGraph/operations",
|
|
58
|
-
queryParameters: [
|
|
59
|
-
Parameters.apiVersion
|
|
60
|
-
],
|
|
61
|
-
headerParameters: [
|
|
62
|
-
Parameters.acceptLanguage
|
|
63
|
-
],
|
|
64
86
|
responses: {
|
|
65
87
|
200: {
|
|
66
88
|
bodyMapper: Mappers.OperationListResult
|
|
@@ -69,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = {
|
|
|
69
91
|
bodyMapper: Mappers.ErrorResponse
|
|
70
92
|
}
|
|
71
93
|
},
|
|
94
|
+
queryParameters: [Parameters.apiVersion],
|
|
95
|
+
urlParameters: [Parameters.$host],
|
|
96
|
+
headerParameters: [Parameters.accept],
|
|
72
97
|
serializer
|
|
73
98
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { Operation, OperationsListOptionalParams } from "../models";
|
|
11
|
+
|
|
12
|
+
/// <reference lib="esnext.asynciterable" />
|
|
13
|
+
/** Interface representing a Operations. */
|
|
14
|
+
export interface Operations {
|
|
15
|
+
/**
|
|
16
|
+
* Lists all of the available REST API operations.
|
|
17
|
+
* @param options The options parameters.
|
|
18
|
+
*/
|
|
19
|
+
list(
|
|
20
|
+
options?: OperationsListOptionalParams
|
|
21
|
+
): PagedAsyncIterableIterator<Operation>;
|
|
22
|
+
}
|
|
@@ -3,79 +3,114 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
7
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import
|
|
9
|
+
import * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as coreAuth from "@azure/core-auth";
|
|
11
|
+
import { OperationsImpl } from "./operations";
|
|
12
|
+
import { Operations } from "./operationsInterfaces";
|
|
13
13
|
import * as Parameters from "./models/parameters";
|
|
14
|
-
import * as
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import * as Mappers from "./models/mappers";
|
|
15
|
+
import {
|
|
16
|
+
ResourceGraphClientOptionalParams,
|
|
17
|
+
QueryRequest,
|
|
18
|
+
ResourcesOptionalParams,
|
|
19
|
+
ResourcesResponse,
|
|
20
|
+
ResourcesHistoryRequest,
|
|
21
|
+
ResourcesHistoryOptionalParams,
|
|
22
|
+
ResourcesHistoryResponse
|
|
23
|
+
} from "./models";
|
|
17
24
|
|
|
18
|
-
class ResourceGraphClient extends
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
export class ResourceGraphClient extends coreClient.ServiceClient {
|
|
26
|
+
$host: string;
|
|
27
|
+
apiVersion: string;
|
|
21
28
|
|
|
22
29
|
/**
|
|
23
30
|
* Initializes a new instance of the ResourceGraphClient class.
|
|
24
|
-
* @param credentials
|
|
25
|
-
* @param
|
|
31
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
32
|
+
* @param options The parameter options
|
|
26
33
|
*/
|
|
27
|
-
constructor(
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
constructor(
|
|
35
|
+
credentials: coreAuth.TokenCredential,
|
|
36
|
+
options?: ResourceGraphClientOptionalParams
|
|
37
|
+
) {
|
|
38
|
+
if (credentials === undefined) {
|
|
39
|
+
throw new Error("'credentials' cannot be null");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Initializing default values for options
|
|
43
|
+
if (!options) {
|
|
44
|
+
options = {};
|
|
45
|
+
}
|
|
46
|
+
const defaults: ResourceGraphClientOptionalParams = {
|
|
47
|
+
requestContentType: "application/json; charset=utf-8",
|
|
48
|
+
credential: credentials
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const packageDetails = `azsdk-js-arm-resourcegraph/5.0.0-beta.1`;
|
|
52
|
+
const userAgentPrefix =
|
|
53
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
54
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
55
|
+
: `${packageDetails}`;
|
|
56
|
+
|
|
57
|
+
if (!options.credentialScopes) {
|
|
58
|
+
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
59
|
+
}
|
|
60
|
+
const optionsWithDefaults = {
|
|
61
|
+
...defaults,
|
|
62
|
+
...options,
|
|
63
|
+
userAgentOptions: {
|
|
64
|
+
userAgentPrefix
|
|
65
|
+
},
|
|
66
|
+
baseUri: options.endpoint || "https://management.azure.com"
|
|
67
|
+
};
|
|
68
|
+
super(optionsWithDefaults);
|
|
69
|
+
|
|
70
|
+
// Assigning values to Constant parameters
|
|
71
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
72
|
+
this.apiVersion = options.apiVersion || "2021-06-01-preview";
|
|
73
|
+
this.operations = new OperationsImpl(this);
|
|
30
74
|
}
|
|
31
75
|
|
|
32
76
|
/**
|
|
33
77
|
* Queries the resources managed by Azure Resource Manager for scopes specified in the request.
|
|
34
78
|
* @param query Request specifying query and its options.
|
|
35
|
-
* @param
|
|
36
|
-
* @returns Promise<Models.ResourcesResponse>
|
|
37
|
-
*/
|
|
38
|
-
resources(query: Models.QueryRequest, options?: msRest.RequestOptionsBase): Promise<Models.ResourcesResponse>;
|
|
39
|
-
/**
|
|
40
|
-
* @param query Request specifying query and its options.
|
|
41
|
-
* @param callback The callback
|
|
79
|
+
* @param options The options parameters.
|
|
42
80
|
*/
|
|
43
|
-
resources(
|
|
81
|
+
resources(
|
|
82
|
+
query: QueryRequest,
|
|
83
|
+
options?: ResourcesOptionalParams
|
|
84
|
+
): Promise<ResourcesResponse> {
|
|
85
|
+
return this.sendOperationRequest(
|
|
86
|
+
{ query, options },
|
|
87
|
+
resourcesOperationSpec
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
44
91
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
92
|
+
* List all snapshots of a resource for a given time interval.
|
|
93
|
+
* @param request Request specifying the query and its options.
|
|
94
|
+
* @param options The options parameters.
|
|
48
95
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
96
|
+
resourcesHistory(
|
|
97
|
+
request: ResourcesHistoryRequest,
|
|
98
|
+
options?: ResourcesHistoryOptionalParams
|
|
99
|
+
): Promise<ResourcesHistoryResponse> {
|
|
51
100
|
return this.sendOperationRequest(
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
resourcesOperationSpec,
|
|
57
|
-
callback) as Promise<Models.ResourcesResponse>;
|
|
101
|
+
{ request, options },
|
|
102
|
+
resourcesHistoryOperationSpec
|
|
103
|
+
);
|
|
58
104
|
}
|
|
59
|
-
}
|
|
60
105
|
|
|
106
|
+
operations: Operations;
|
|
107
|
+
}
|
|
61
108
|
// Operation Specifications
|
|
62
|
-
const serializer =
|
|
63
|
-
|
|
109
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
110
|
+
|
|
111
|
+
const resourcesOperationSpec: coreClient.OperationSpec = {
|
|
112
|
+
path: "/providers/Microsoft.ResourceGraph/resources",
|
|
64
113
|
httpMethod: "POST",
|
|
65
|
-
path: "providers/Microsoft.ResourceGraph/resources",
|
|
66
|
-
queryParameters: [
|
|
67
|
-
Parameters.apiVersion
|
|
68
|
-
],
|
|
69
|
-
headerParameters: [
|
|
70
|
-
Parameters.acceptLanguage
|
|
71
|
-
],
|
|
72
|
-
requestBody: {
|
|
73
|
-
parameterPath: "query",
|
|
74
|
-
mapper: {
|
|
75
|
-
...Mappers.QueryRequest,
|
|
76
|
-
required: true
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
114
|
responses: {
|
|
80
115
|
200: {
|
|
81
116
|
bodyMapper: Mappers.QueryResponse
|
|
@@ -84,13 +119,30 @@ const resourcesOperationSpec: msRest.OperationSpec = {
|
|
|
84
119
|
bodyMapper: Mappers.ErrorResponse
|
|
85
120
|
}
|
|
86
121
|
},
|
|
122
|
+
requestBody: Parameters.query,
|
|
123
|
+
queryParameters: [Parameters.apiVersion],
|
|
124
|
+
urlParameters: [Parameters.$host],
|
|
125
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
126
|
+
mediaType: "json",
|
|
87
127
|
serializer
|
|
88
128
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
129
|
+
const resourcesHistoryOperationSpec: coreClient.OperationSpec = {
|
|
130
|
+
path: "/providers/Microsoft.ResourceGraph/resourcesHistory",
|
|
131
|
+
httpMethod: "POST",
|
|
132
|
+
responses: {
|
|
133
|
+
200: {
|
|
134
|
+
bodyMapper: {
|
|
135
|
+
type: { name: "Dictionary", value: { type: { name: "any" } } }
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
default: {
|
|
139
|
+
bodyMapper: Mappers.ErrorResponse
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
requestBody: Parameters.request,
|
|
143
|
+
queryParameters: [Parameters.apiVersion],
|
|
144
|
+
urlParameters: [Parameters.$host],
|
|
145
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
146
|
+
mediaType: "json",
|
|
147
|
+
serializer
|
|
95
148
|
};
|
|
96
|
-
export * from "./operations";
|
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"module": "es6",
|
|
4
4
|
"moduleResolution": "node",
|
|
5
5
|
"strict": true,
|
|
6
|
-
"target": "
|
|
6
|
+
"target": "es6",
|
|
7
7
|
"sourceMap": true,
|
|
8
8
|
"declarationMap": true,
|
|
9
9
|
"esModuleInterop": true,
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"forceConsistentCasingInFileNames": true,
|
|
12
12
|
"lib": ["es6", "dom"],
|
|
13
13
|
"declaration": true,
|
|
14
|
-
"outDir": "./esm",
|
|
15
|
-
"importHelpers": true
|
|
14
|
+
"outDir": "./dist-esm",
|
|
15
|
+
"importHelpers": true,
|
|
16
|
+
"paths": { "@azure/arm-resourcegraph": ["./src/index"] }
|
|
16
17
|
},
|
|
17
|
-
"include": ["./src/**/*.ts"],
|
|
18
|
+
"include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"],
|
|
18
19
|
"exclude": ["node_modules"]
|
|
19
20
|
}
|