@azure/arm-resourcegraph 5.0.0-beta.3 → 5.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 +12 -2
- package/LICENSE +4 -4
- package/README.md +26 -17
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/index.js +4 -4
- package/dist/browser/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/models/index.d.ts +9 -9
- package/dist/browser/models/index.d.ts.map +1 -0
- package/dist/browser/models/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/models/mappers.js +14 -6
- package/dist/browser/models/mappers.js.map +1 -0
- package/{dist-esm/src → dist/browser}/models/parameters.js +1 -1
- package/dist/browser/models/parameters.js.map +1 -0
- package/dist/browser/operations/index.d.ts +2 -0
- package/{dist-esm/src → dist/browser}/operations/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/operations/index.js +1 -1
- package/dist/browser/operations/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/operations/operations.d.ts +3 -3
- package/dist/browser/operations/operations.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/operations/operations.js +12 -27
- package/dist/browser/operations/operations.js.map +1 -0
- package/dist/browser/operationsInterfaces/index.d.ts +2 -0
- package/{dist-esm/src → dist/browser}/operationsInterfaces/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/operationsInterfaces/index.js +1 -1
- package/dist/browser/operationsInterfaces/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/operationsInterfaces/operations.d.ts +1 -1
- package/{dist-esm/src → dist/browser}/operationsInterfaces/operations.d.ts.map +1 -1
- package/dist/browser/operationsInterfaces/operations.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/{dist-esm/src → dist/browser}/pagingHelper.js +2 -4
- package/dist/browser/pagingHelper.js.map +1 -0
- package/{dist-esm/src → dist/browser}/resourceGraphClient.d.ts +2 -2
- package/dist/browser/resourceGraphClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/resourceGraphClient.js +31 -26
- package/dist/browser/resourceGraphClient.js.map +1 -0
- package/dist/commonjs/index.d.ts +5 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +19 -0
- package/dist/commonjs/index.js.map +1 -0
- package/{types/arm-resourcegraph.d.ts → dist/commonjs/models/index.d.ts} +216 -295
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +10 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/mappers.d.ts +26 -0
- package/dist/commonjs/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/models/mappers.js +666 -0
- package/dist/commonjs/models/mappers.js.map +1 -0
- package/dist/commonjs/models/parameters.d.ts +8 -0
- package/dist/commonjs/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/models/parameters.js +64 -0
- package/dist/commonjs/models/parameters.js.map +1 -0
- package/dist/commonjs/operations/index.d.ts +2 -0
- package/dist/commonjs/operations/index.d.ts.map +1 -0
- package/dist/commonjs/operations/index.js +12 -0
- package/dist/commonjs/operations/index.js.map +1 -0
- package/dist/commonjs/operations/operations.d.ts +26 -0
- package/dist/commonjs/operations/operations.d.ts.map +1 -0
- package/dist/commonjs/operations/operations.js +84 -0
- package/dist/commonjs/operations/operations.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/index.d.ts +2 -0
- package/dist/commonjs/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/index.js +12 -0
- package/dist/commonjs/operationsInterfaces/index.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/operations.d.ts +11 -0
- package/dist/commonjs/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/operations.js +10 -0
- package/dist/commonjs/operationsInterfaces/operations.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/pagingHelper.d.ts +13 -0
- package/dist/commonjs/pagingHelper.d.ts.map +1 -0
- package/dist/commonjs/pagingHelper.js +34 -0
- package/dist/commonjs/pagingHelper.js.map +1 -0
- package/dist/commonjs/resourceGraphClient.d.ts +30 -0
- package/dist/commonjs/resourceGraphClient.d.ts.map +1 -0
- package/dist/commonjs/resourceGraphClient.js +162 -0
- package/dist/commonjs/resourceGraphClient.js.map +1 -0
- package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/{src/index.ts → dist/esm/index.js} +5 -5
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models/index.d.ts +216 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/{src/operations/index.ts → dist/esm/models/index.js} +2 -2
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/mappers.d.ts +26 -0
- package/dist/esm/models/mappers.d.ts.map +1 -0
- package/dist/{index.js → esm/models/mappers.js} +35 -402
- package/dist/esm/models/mappers.js.map +1 -0
- package/dist/esm/models/parameters.d.ts +8 -0
- package/dist/esm/models/parameters.d.ts.map +1 -0
- package/dist/esm/models/parameters.js +61 -0
- package/dist/esm/models/parameters.js.map +1 -0
- package/dist/esm/operations/index.d.ts +2 -0
- package/dist/esm/operations/index.d.ts.map +1 -0
- package/dist/esm/operations/index.js +9 -0
- package/dist/esm/operations/index.js.map +1 -0
- package/dist/esm/operations/operations.d.ts +26 -0
- package/dist/esm/operations/operations.d.ts.map +1 -0
- package/dist/esm/operations/operations.js +79 -0
- package/dist/esm/operations/operations.js.map +1 -0
- package/dist/esm/operationsInterfaces/index.d.ts +2 -0
- package/dist/esm/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/index.js +9 -0
- package/dist/esm/operationsInterfaces/index.js.map +1 -0
- package/dist/esm/operationsInterfaces/operations.d.ts +11 -0
- package/dist/esm/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/operations.js +9 -0
- package/dist/esm/operationsInterfaces/operations.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pagingHelper.d.ts +13 -0
- package/dist/esm/pagingHelper.d.ts.map +1 -0
- package/dist/esm/pagingHelper.js +30 -0
- package/dist/esm/pagingHelper.js.map +1 -0
- package/dist/esm/resourceGraphClient.d.ts +30 -0
- package/dist/esm/resourceGraphClient.d.ts.map +1 -0
- package/dist/esm/resourceGraphClient.js +157 -0
- package/dist/esm/resourceGraphClient.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/models/index.d.ts +216 -0
- package/dist/react-native/models/index.d.ts.map +1 -0
- package/{src/operationsInterfaces/index.ts → dist/react-native/models/index.js} +2 -2
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/mappers.d.ts +26 -0
- package/dist/react-native/models/mappers.d.ts.map +1 -0
- package/dist/react-native/models/mappers.js +663 -0
- package/dist/react-native/models/mappers.js.map +1 -0
- package/dist/react-native/models/parameters.d.ts +8 -0
- package/dist/react-native/models/parameters.d.ts.map +1 -0
- package/dist/react-native/models/parameters.js +61 -0
- package/dist/react-native/models/parameters.js.map +1 -0
- package/dist/react-native/operations/index.d.ts +2 -0
- package/dist/react-native/operations/index.d.ts.map +1 -0
- package/dist/react-native/operations/index.js +9 -0
- package/dist/react-native/operations/index.js.map +1 -0
- package/dist/react-native/operations/operations.d.ts +26 -0
- package/dist/react-native/operations/operations.d.ts.map +1 -0
- package/dist/react-native/operations/operations.js +79 -0
- package/dist/react-native/operations/operations.js.map +1 -0
- package/dist/react-native/operationsInterfaces/index.d.ts +2 -0
- package/dist/react-native/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/index.js +9 -0
- package/dist/react-native/operationsInterfaces/index.js.map +1 -0
- package/dist/react-native/operationsInterfaces/operations.d.ts +11 -0
- package/dist/react-native/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/operations.js +9 -0
- package/dist/react-native/operationsInterfaces/operations.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/pagingHelper.d.ts +13 -0
- package/dist/react-native/pagingHelper.d.ts.map +1 -0
- package/dist/react-native/pagingHelper.js +30 -0
- package/dist/react-native/pagingHelper.js.map +1 -0
- package/dist/react-native/resourceGraphClient.d.ts +30 -0
- package/dist/react-native/resourceGraphClient.d.ts.map +1 -0
- package/dist/react-native/resourceGraphClient.js +157 -0
- package/dist/react-native/resourceGraphClient.js.map +1 -0
- package/package.json +82 -71
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist-esm/samples-dev/operationsListSample.d.ts +0 -2
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +0 -1
- package/dist-esm/samples-dev/operationsListSample.js +0 -42
- package/dist-esm/samples-dev/operationsListSample.js.map +0 -1
- package/dist-esm/samples-dev/resourcesHistorySample.d.ts +0 -2
- package/dist-esm/samples-dev/resourcesHistorySample.d.ts.map +0 -1
- package/dist-esm/samples-dev/resourcesHistorySample.js +0 -63
- package/dist-esm/samples-dev/resourcesHistorySample.js.map +0 -1
- package/dist-esm/samples-dev/resourcesSample.d.ts +0 -2
- package/dist-esm/samples-dev/resourcesSample.d.ts.map +0 -1
- package/dist-esm/samples-dev/resourcesSample.js +0 -245
- package/dist-esm/samples-dev/resourcesSample.js.map +0 -1
- package/dist-esm/src/index.d.ts +0 -6
- package/dist-esm/src/index.d.ts.map +0 -1
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models/index.d.ts.map +0 -1
- package/dist-esm/src/models/index.js.map +0 -1
- package/dist-esm/src/models/mappers.js.map +0 -1
- package/dist-esm/src/models/parameters.js.map +0 -1
- package/dist-esm/src/operations/index.d.ts +0 -2
- package/dist-esm/src/operations/index.js.map +0 -1
- package/dist-esm/src/operations/operations.d.ts.map +0 -1
- package/dist-esm/src/operations/operations.js.map +0 -1
- package/dist-esm/src/operationsInterfaces/index.d.ts +0 -2
- package/dist-esm/src/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/src/operationsInterfaces/operations.js.map +0 -1
- package/dist-esm/src/pagingHelper.js.map +0 -1
- package/dist-esm/src/resourceGraphClient.d.ts.map +0 -1
- package/dist-esm/src/resourceGraphClient.js.map +0 -1
- package/dist-esm/test/sampleTest.d.ts +0 -2
- package/dist-esm/test/sampleTest.d.ts.map +0 -1
- package/dist-esm/test/sampleTest.js +0 -38
- package/dist-esm/test/sampleTest.js.map +0 -1
- package/rollup.config.js +0 -122
- package/src/models/index.ts +0 -261
- package/src/models/mappers.ts +0 -684
- package/src/models/parameters.ts +0 -75
- package/src/operations/operations.ts +0 -103
- package/src/operationsInterfaces/operations.ts +0 -22
- package/src/pagingHelper.ts +0 -39
- package/src/resourceGraphClient.ts +0 -213
- package/tsconfig.json +0 -33
- /package/{dist-esm/src → dist/browser}/models/index.js +0 -0
- /package/{dist-esm/src → dist/browser}/models/mappers.d.ts +0 -0
- /package/{dist-esm/src → dist/browser}/models/mappers.d.ts.map +0 -0
- /package/{dist-esm/src → dist/browser}/models/parameters.d.ts +0 -0
- /package/{dist-esm/src → dist/browser}/models/parameters.d.ts.map +0 -0
- /package/{dist-esm/src → dist/browser}/operationsInterfaces/operations.js +0 -0
- /package/{dist-esm/src → dist/browser}/pagingHelper.d.ts +0 -0
- /package/{dist-esm/src → dist/browser}/pagingHelper.d.ts.map +0 -0
- /package/review/{arm-resourcegraph.api.md → arm-resourcegraph-node.api.md} +0 -0
package/src/models/parameters.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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 {
|
|
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";
|
|
18
|
-
|
|
19
|
-
export const contentType: OperationParameter = {
|
|
20
|
-
parameterPath: ["options", "contentType"],
|
|
21
|
-
mapper: {
|
|
22
|
-
defaultValue: "application/json",
|
|
23
|
-
isConstant: true,
|
|
24
|
-
serializedName: "Content-Type",
|
|
25
|
-
type: {
|
|
26
|
-
name: "String"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
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",
|
|
50
|
-
mapper: {
|
|
51
|
-
serializedName: "$host",
|
|
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,
|
|
65
|
-
serializedName: "api-version",
|
|
66
|
-
type: {
|
|
67
|
-
name: "String"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const request: OperationParameter = {
|
|
73
|
-
parameterPath: "request",
|
|
74
|
-
mapper: ResourcesHistoryRequestMapper
|
|
75
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
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, PageSettings } 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
|
-
import * as Parameters from "../models/parameters";
|
|
14
|
-
import { ResourceGraphClient } from "../resourceGraphClient";
|
|
15
|
-
import {
|
|
16
|
-
Operation,
|
|
17
|
-
OperationsListOptionalParams,
|
|
18
|
-
OperationsListResponse
|
|
19
|
-
} from "../models";
|
|
20
|
-
|
|
21
|
-
/// <reference lib="esnext.asynciterable" />
|
|
22
|
-
/** Class containing Operations operations. */
|
|
23
|
-
export class OperationsImpl implements Operations {
|
|
24
|
-
private readonly client: ResourceGraphClient;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Initialize a new instance of the class Operations class.
|
|
28
|
-
* @param client Reference to the service client
|
|
29
|
-
*/
|
|
30
|
-
constructor(client: ResourceGraphClient) {
|
|
31
|
-
this.client = client;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Lists all of the available REST API operations.
|
|
36
|
-
* @param options The options parameters.
|
|
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: (settings?: PageSettings) => {
|
|
50
|
-
if (settings?.maxPageSize) {
|
|
51
|
-
throw new Error("maxPageSize is not supported by this operation.");
|
|
52
|
-
}
|
|
53
|
-
return this.listPagingPage(options, settings);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private async *listPagingPage(
|
|
59
|
-
options?: OperationsListOptionalParams,
|
|
60
|
-
_settings?: PageSettings
|
|
61
|
-
): AsyncIterableIterator<Operation[]> {
|
|
62
|
-
let result: OperationsListResponse;
|
|
63
|
-
result = await this._list(options);
|
|
64
|
-
yield result.value || [];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
private async *listPagingAll(
|
|
68
|
-
options?: OperationsListOptionalParams
|
|
69
|
-
): AsyncIterableIterator<Operation> {
|
|
70
|
-
for await (const page of this.listPagingPage(options)) {
|
|
71
|
-
yield* page;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Lists all of the available REST API operations.
|
|
77
|
-
* @param options The options parameters.
|
|
78
|
-
*/
|
|
79
|
-
private _list(
|
|
80
|
-
options?: OperationsListOptionalParams
|
|
81
|
-
): Promise<OperationsListResponse> {
|
|
82
|
-
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Operation Specifications
|
|
86
|
-
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
87
|
-
|
|
88
|
-
const listOperationSpec: coreClient.OperationSpec = {
|
|
89
|
-
path: "/providers/Microsoft.ResourceGraph/operations",
|
|
90
|
-
httpMethod: "GET",
|
|
91
|
-
responses: {
|
|
92
|
-
200: {
|
|
93
|
-
bodyMapper: Mappers.OperationListResult
|
|
94
|
-
},
|
|
95
|
-
default: {
|
|
96
|
-
bodyMapper: Mappers.ErrorResponse
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
queryParameters: [Parameters.apiVersion],
|
|
100
|
-
urlParameters: [Parameters.$host],
|
|
101
|
-
headerParameters: [Parameters.accept],
|
|
102
|
-
serializer
|
|
103
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
package/src/pagingHelper.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export interface PageInfo {
|
|
10
|
-
continuationToken?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const pageMap = new WeakMap<object, PageInfo>();
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Given the last `.value` produced by the `byPage` iterator,
|
|
17
|
-
* returns a continuation token that can be used to begin paging from
|
|
18
|
-
* that point later.
|
|
19
|
-
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
20
|
-
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
21
|
-
*/
|
|
22
|
-
export function getContinuationToken(page: unknown): string | undefined {
|
|
23
|
-
if (typeof page !== "object" || page === null) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
return pageMap.get(page)?.continuationToken;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function setContinuationToken(
|
|
30
|
-
page: unknown,
|
|
31
|
-
continuationToken: string | undefined
|
|
32
|
-
): void {
|
|
33
|
-
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const pageInfo = pageMap.get(page) ?? {};
|
|
37
|
-
pageInfo.continuationToken = continuationToken;
|
|
38
|
-
pageMap.set(page, pageInfo);
|
|
39
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
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 { OperationsImpl } from "./operations";
|
|
18
|
-
import { Operations } from "./operationsInterfaces";
|
|
19
|
-
import * as Parameters from "./models/parameters";
|
|
20
|
-
import * as Mappers from "./models/mappers";
|
|
21
|
-
import {
|
|
22
|
-
ResourceGraphClientOptionalParams,
|
|
23
|
-
QueryRequest,
|
|
24
|
-
ResourcesOptionalParams,
|
|
25
|
-
ResourcesResponse,
|
|
26
|
-
ResourcesHistoryRequest,
|
|
27
|
-
ResourcesHistoryOptionalParams,
|
|
28
|
-
ResourcesHistoryResponse
|
|
29
|
-
} from "./models";
|
|
30
|
-
|
|
31
|
-
export class ResourceGraphClient extends coreClient.ServiceClient {
|
|
32
|
-
$host: string;
|
|
33
|
-
apiVersion: string;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Initializes a new instance of the ResourceGraphClient class.
|
|
37
|
-
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
38
|
-
* @param options The parameter options
|
|
39
|
-
*/
|
|
40
|
-
constructor(
|
|
41
|
-
credentials: coreAuth.TokenCredential,
|
|
42
|
-
options?: ResourceGraphClientOptionalParams
|
|
43
|
-
) {
|
|
44
|
-
if (credentials === undefined) {
|
|
45
|
-
throw new Error("'credentials' cannot be null");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Initializing default values for options
|
|
49
|
-
if (!options) {
|
|
50
|
-
options = {};
|
|
51
|
-
}
|
|
52
|
-
const defaults: ResourceGraphClientOptionalParams = {
|
|
53
|
-
requestContentType: "application/json; charset=utf-8",
|
|
54
|
-
credential: credentials
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const packageDetails = `azsdk-js-arm-resourcegraph/5.0.0-beta.3`;
|
|
58
|
-
const userAgentPrefix =
|
|
59
|
-
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
60
|
-
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
61
|
-
: `${packageDetails}`;
|
|
62
|
-
|
|
63
|
-
const optionsWithDefaults = {
|
|
64
|
-
...defaults,
|
|
65
|
-
...options,
|
|
66
|
-
userAgentOptions: {
|
|
67
|
-
userAgentPrefix
|
|
68
|
-
},
|
|
69
|
-
endpoint:
|
|
70
|
-
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
71
|
-
};
|
|
72
|
-
super(optionsWithDefaults);
|
|
73
|
-
|
|
74
|
-
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
75
|
-
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
76
|
-
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
77
|
-
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
78
|
-
(pipelinePolicy) =>
|
|
79
|
-
pipelinePolicy.name ===
|
|
80
|
-
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
if (
|
|
84
|
-
!options ||
|
|
85
|
-
!options.pipeline ||
|
|
86
|
-
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
87
|
-
!bearerTokenAuthenticationPolicyFound
|
|
88
|
-
) {
|
|
89
|
-
this.pipeline.removePolicy({
|
|
90
|
-
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
91
|
-
});
|
|
92
|
-
this.pipeline.addPolicy(
|
|
93
|
-
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
94
|
-
credential: credentials,
|
|
95
|
-
scopes:
|
|
96
|
-
optionsWithDefaults.credentialScopes ??
|
|
97
|
-
`${optionsWithDefaults.endpoint}/.default`,
|
|
98
|
-
challengeCallbacks: {
|
|
99
|
-
authorizeRequestOnChallenge:
|
|
100
|
-
coreClient.authorizeRequestOnClaimChallenge
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Assigning values to Constant parameters
|
|
107
|
-
this.$host = options.$host || "https://management.azure.com";
|
|
108
|
-
this.apiVersion = options.apiVersion || "2021-06-01-preview";
|
|
109
|
-
this.operations = new OperationsImpl(this);
|
|
110
|
-
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
114
|
-
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
115
|
-
if (!apiVersion) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const apiVersionPolicy = {
|
|
119
|
-
name: "CustomApiVersionPolicy",
|
|
120
|
-
async sendRequest(
|
|
121
|
-
request: PipelineRequest,
|
|
122
|
-
next: SendRequest
|
|
123
|
-
): Promise<PipelineResponse> {
|
|
124
|
-
const param = request.url.split("?");
|
|
125
|
-
if (param.length > 1) {
|
|
126
|
-
const newParams = param[1].split("&").map((item) => {
|
|
127
|
-
if (item.indexOf("api-version") > -1) {
|
|
128
|
-
return "api-version=" + apiVersion;
|
|
129
|
-
} else {
|
|
130
|
-
return item;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
request.url = param[0] + "?" + newParams.join("&");
|
|
134
|
-
}
|
|
135
|
-
return next(request);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
this.pipeline.addPolicy(apiVersionPolicy);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Queries the resources managed by Azure Resource Manager for scopes specified in the request.
|
|
143
|
-
* @param query Request specifying query and its options.
|
|
144
|
-
* @param options The options parameters.
|
|
145
|
-
*/
|
|
146
|
-
resources(
|
|
147
|
-
query: QueryRequest,
|
|
148
|
-
options?: ResourcesOptionalParams
|
|
149
|
-
): Promise<ResourcesResponse> {
|
|
150
|
-
return this.sendOperationRequest(
|
|
151
|
-
{ query, options },
|
|
152
|
-
resourcesOperationSpec
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* List all snapshots of a resource for a given time interval.
|
|
158
|
-
* @param request Request specifying the query and its options.
|
|
159
|
-
* @param options The options parameters.
|
|
160
|
-
*/
|
|
161
|
-
resourcesHistory(
|
|
162
|
-
request: ResourcesHistoryRequest,
|
|
163
|
-
options?: ResourcesHistoryOptionalParams
|
|
164
|
-
): Promise<ResourcesHistoryResponse> {
|
|
165
|
-
return this.sendOperationRequest(
|
|
166
|
-
{ request, options },
|
|
167
|
-
resourcesHistoryOperationSpec
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
operations: Operations;
|
|
172
|
-
}
|
|
173
|
-
// Operation Specifications
|
|
174
|
-
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
175
|
-
|
|
176
|
-
const resourcesOperationSpec: coreClient.OperationSpec = {
|
|
177
|
-
path: "/providers/Microsoft.ResourceGraph/resources",
|
|
178
|
-
httpMethod: "POST",
|
|
179
|
-
responses: {
|
|
180
|
-
200: {
|
|
181
|
-
bodyMapper: Mappers.QueryResponse
|
|
182
|
-
},
|
|
183
|
-
default: {
|
|
184
|
-
bodyMapper: Mappers.ErrorResponse
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
requestBody: Parameters.query,
|
|
188
|
-
queryParameters: [Parameters.apiVersion],
|
|
189
|
-
urlParameters: [Parameters.$host],
|
|
190
|
-
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
191
|
-
mediaType: "json",
|
|
192
|
-
serializer
|
|
193
|
-
};
|
|
194
|
-
const resourcesHistoryOperationSpec: coreClient.OperationSpec = {
|
|
195
|
-
path: "/providers/Microsoft.ResourceGraph/resourcesHistory",
|
|
196
|
-
httpMethod: "POST",
|
|
197
|
-
responses: {
|
|
198
|
-
200: {
|
|
199
|
-
bodyMapper: {
|
|
200
|
-
type: { name: "Dictionary", value: { type: { name: "any" } } }
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
default: {
|
|
204
|
-
bodyMapper: Mappers.ErrorResponse
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
requestBody: Parameters.request,
|
|
208
|
-
queryParameters: [Parameters.apiVersion],
|
|
209
|
-
urlParameters: [Parameters.$host],
|
|
210
|
-
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
211
|
-
mediaType: "json",
|
|
212
|
-
serializer
|
|
213
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "es6",
|
|
4
|
-
"moduleResolution": "node",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"target": "es6",
|
|
7
|
-
"sourceMap": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"lib": [
|
|
13
|
-
"es6",
|
|
14
|
-
"dom"
|
|
15
|
-
],
|
|
16
|
-
"declaration": true,
|
|
17
|
-
"outDir": "./dist-esm",
|
|
18
|
-
"importHelpers": true,
|
|
19
|
-
"paths": {
|
|
20
|
-
"@azure/arm-resourcegraph": [
|
|
21
|
-
"./src/index"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"./src/**/*.ts",
|
|
27
|
-
"./test/**/*.ts",
|
|
28
|
-
"samples-dev/**/*.ts"
|
|
29
|
-
],
|
|
30
|
-
"exclude": [
|
|
31
|
-
"node_modules"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|