@azure/arm-commitmentplans 1.3.1 → 2.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 +69 -80
- package/dist/index.js +1794 -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/src/azureMLCommitmentPlansManagementClient.d.ts +22 -0
- package/dist-esm/src/azureMLCommitmentPlansManagementClient.d.ts.map +1 -0
- package/dist-esm/src/azureMLCommitmentPlansManagementClient.js +55 -0
- package/dist-esm/src/azureMLCommitmentPlansManagementClient.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 +522 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +27 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +24 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +352 -337
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +15 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +125 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/commitmentAssociations.d.ts +55 -0
- package/dist-esm/src/operations/commitmentAssociations.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentAssociations.js +203 -0
- package/dist-esm/src/operations/commitmentAssociations.js.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts +84 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.js +332 -0
- package/dist-esm/src/operations/commitmentPlans.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +1 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +4 -5
- 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 +87 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/skus.d.ts +26 -0
- package/dist-esm/src/operations/skus.d.ts.map +1 -0
- package/dist-esm/src/operations/skus.js +87 -0
- package/dist-esm/src/operations/skus.js.map +1 -0
- package/dist-esm/src/operations/usageHistory.d.ts +38 -0
- package/dist-esm/src/operations/usageHistory.d.ts.map +1 -0
- package/dist-esm/src/operations/usageHistory.js +131 -0
- package/dist-esm/src/operations/usageHistory.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentAssociations.d.ts +30 -0
- package/dist-esm/src/operationsInterfaces/commitmentAssociations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentAssociations.js +9 -0
- package/dist-esm/src/operationsInterfaces/commitmentAssociations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +48 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.js +9 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/skus.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/skus.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/skus.js +9 -0
- package/dist-esm/src/operationsInterfaces/skus.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageHistory.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/usageHistory.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageHistory.js +9 -0
- package/dist-esm/src/operationsInterfaces/usageHistory.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 +74 -33
- package/review/arm-commitmentplans.api.md +405 -0
- package/rollup.config.js +184 -27
- package/src/azureMLCommitmentPlansManagementClient.ts +82 -41
- package/src/index.ts +12 -0
- package/src/models/index.ts +388 -745
- package/src/models/mappers.ts +354 -336
- package/src/models/parameters.ts +87 -35
- package/src/operations/commitmentAssociations.ts +183 -174
- package/src/operations/commitmentPlans.ts +277 -340
- package/src/operations/index.ts +4 -5
- package/src/operations/operations.ts +95 -0
- package/src/operations/skus.ts +65 -48
- package/src/operations/usageHistory.ts +135 -89
- package/src/operationsInterfaces/commitmentAssociations.ts +62 -0
- package/src/operationsInterfaces/commitmentPlans.ts +92 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/skus.ts +22 -0
- package/src/operationsInterfaces/usageHistory.ts +26 -0
- package/tsconfig.json +6 -5
- package/types/arm-commitmentplans.d.ts +706 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-commitmentplans.js +0 -1659
- package/dist/arm-commitmentplans.js.map +0 -1
- package/dist/arm-commitmentplans.min.js +0 -1
- package/dist/arm-commitmentplans.min.js.map +0 -1
- package/esm/azureMLCommitmentPlansManagementClient.d.ts +0 -27
- package/esm/azureMLCommitmentPlansManagementClient.d.ts.map +0 -1
- package/esm/azureMLCommitmentPlansManagementClient.js +0 -41
- package/esm/azureMLCommitmentPlansManagementClient.js.map +0 -1
- package/esm/azureMLCommitmentPlansManagementClientContext.d.ts +0 -22
- package/esm/azureMLCommitmentPlansManagementClientContext.d.ts.map +0 -1
- package/esm/azureMLCommitmentPlansManagementClientContext.js +0 -61
- package/esm/azureMLCommitmentPlansManagementClientContext.js.map +0 -1
- package/esm/models/commitmentAssociationsMappers.d.ts +0 -2
- package/esm/models/commitmentAssociationsMappers.d.ts.map +0 -1
- package/esm/models/commitmentAssociationsMappers.js +0 -11
- package/esm/models/commitmentAssociationsMappers.js.map +0 -1
- package/esm/models/commitmentPlansMappers.d.ts +0 -2
- package/esm/models/commitmentPlansMappers.d.ts.map +0 -1
- package/esm/models/commitmentPlansMappers.js +0 -11
- package/esm/models/commitmentPlansMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -901
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -10
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -23
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -10
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -93
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/skusMappers.d.ts +0 -2
- package/esm/models/skusMappers.d.ts.map +0 -1
- package/esm/models/skusMappers.js +0 -11
- package/esm/models/skusMappers.js.map +0 -1
- package/esm/models/usageHistoryMappers.d.ts +0 -2
- package/esm/models/usageHistoryMappers.d.ts.map +0 -1
- package/esm/models/usageHistoryMappers.js +0 -11
- package/esm/models/usageHistoryMappers.js.map +0 -1
- package/esm/operations/commitmentAssociations.d.ts +0 -103
- package/esm/operations/commitmentAssociations.d.ts.map +0 -1
- package/esm/operations/commitmentAssociations.js +0 -157
- package/esm/operations/commitmentAssociations.js.map +0 -1
- package/esm/operations/commitmentPlans.d.ts +0 -175
- package/esm/operations/commitmentPlans.d.ts.map +0 -1
- package/esm/operations/commitmentPlans.js +0 -273
- package/esm/operations/commitmentPlans.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/skus.d.ts +0 -28
- package/esm/operations/skus.d.ts.map +0 -1
- package/esm/operations/skus.js +0 -54
- package/esm/operations/skus.js.map +0 -1
- package/esm/operations/usageHistory.d.ts +0 -52
- package/esm/operations/usageHistory.d.ts.map +0 -1
- package/esm/operations/usageHistory.js +0 -85
- package/esm/operations/usageHistory.js.map +0 -1
- package/src/azureMLCommitmentPlansManagementClientContext.ts +0 -68
- package/src/models/commitmentAssociationsMappers.ts +0 -24
- package/src/models/commitmentPlansMappers.ts +0 -24
- package/src/models/skusMappers.ts +0 -20
- package/src/models/usageHistoryMappers.ts +0 -16
package/src/operations/index.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* license information.
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
5
4
|
*
|
|
6
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9
7
|
*/
|
|
10
8
|
|
|
9
|
+
export * from "./operations";
|
|
11
10
|
export * from "./skus";
|
|
12
11
|
export * from "./commitmentAssociations";
|
|
13
12
|
export * from "./commitmentPlans";
|
|
@@ -0,0 +1,95 @@
|
|
|
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 { 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 { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
OperationEntity,
|
|
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: AzureMLCommitmentPlansManagementClient;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Initialize a new instance of the class Operations class.
|
|
28
|
+
* @param client Reference to the service client
|
|
29
|
+
*/
|
|
30
|
+
constructor(client: AzureMLCommitmentPlansManagementClient) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Lists all of the available Azure Machine Learning Studio Commitment Plan RP REST API operations.
|
|
36
|
+
* @param options The options parameters.
|
|
37
|
+
*/
|
|
38
|
+
public list(
|
|
39
|
+
options?: OperationsListOptionalParams
|
|
40
|
+
): PagedAsyncIterableIterator<OperationEntity> {
|
|
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<OperationEntity[]> {
|
|
58
|
+
let result = await this._list(options);
|
|
59
|
+
yield result.value || [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async *listPagingAll(
|
|
63
|
+
options?: OperationsListOptionalParams
|
|
64
|
+
): AsyncIterableIterator<OperationEntity> {
|
|
65
|
+
for await (const page of this.listPagingPage(options)) {
|
|
66
|
+
yield* page;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Lists all of the available Azure Machine Learning Studio Commitment Plan RP REST API operations.
|
|
72
|
+
* @param options The options parameters.
|
|
73
|
+
*/
|
|
74
|
+
private _list(
|
|
75
|
+
options?: OperationsListOptionalParams
|
|
76
|
+
): Promise<OperationsListResponse> {
|
|
77
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Operation Specifications
|
|
81
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
82
|
+
|
|
83
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
84
|
+
path: "/providers/Microsoft.MachineLearning/operations",
|
|
85
|
+
httpMethod: "GET",
|
|
86
|
+
responses: {
|
|
87
|
+
200: {
|
|
88
|
+
bodyMapper: Mappers.OperationEntityListResult
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
queryParameters: [Parameters.apiVersion],
|
|
92
|
+
urlParameters: [Parameters.$host],
|
|
93
|
+
headerParameters: [Parameters.accept],
|
|
94
|
+
serializer
|
|
95
|
+
};
|
package/src/operations/skus.ts
CHANGED
|
@@ -1,77 +1,94 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* license information.
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
5
4
|
*
|
|
6
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { Skus } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
14
13
|
import * as Parameters from "../models/parameters";
|
|
15
|
-
import {
|
|
14
|
+
import { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
CatalogSku,
|
|
17
|
+
SkusListOptionalParams,
|
|
18
|
+
SkusListResponse
|
|
19
|
+
} from "../models";
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
/// <reference lib="esnext.asynciterable" />
|
|
22
|
+
/** Class containing Skus operations. */
|
|
23
|
+
export class SkusImpl implements Skus {
|
|
24
|
+
private readonly client: AzureMLCommitmentPlansManagementClient;
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
27
|
+
* Initialize a new instance of the class Skus class.
|
|
28
|
+
* @param client Reference to the service client
|
|
24
29
|
*/
|
|
25
|
-
constructor(client:
|
|
30
|
+
constructor(client: AzureMLCommitmentPlansManagementClient) {
|
|
26
31
|
this.client = client;
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* Lists the available commitment plan SKUs.
|
|
31
|
-
* @param
|
|
32
|
-
* @returns Promise<Models.SkusListResponse>
|
|
36
|
+
* @param options The options parameters.
|
|
33
37
|
*/
|
|
34
|
-
list(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
public list(
|
|
39
|
+
options?: SkusListOptionalParams
|
|
40
|
+
): PagedAsyncIterableIterator<CatalogSku> {
|
|
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?: SkusListOptionalParams
|
|
57
|
+
): AsyncIterableIterator<CatalogSku[]> {
|
|
58
|
+
let result = await this._list(options);
|
|
59
|
+
yield result.value || [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async *listPagingAll(
|
|
63
|
+
options?: SkusListOptionalParams
|
|
64
|
+
): AsyncIterableIterator<CatalogSku> {
|
|
65
|
+
for await (const page of this.listPagingPage(options)) {
|
|
66
|
+
yield* page;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
39
70
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param
|
|
71
|
+
* Lists the available commitment plan SKUs.
|
|
72
|
+
* @param options The options parameters.
|
|
42
73
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return this.client.sendOperationRequest(
|
|
46
|
-
{
|
|
47
|
-
options
|
|
48
|
-
},
|
|
49
|
-
listOperationSpec,
|
|
50
|
-
callback) as Promise<Models.SkusListResponse>;
|
|
74
|
+
private _list(options?: SkusListOptionalParams): Promise<SkusListResponse> {
|
|
75
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
51
76
|
}
|
|
52
77
|
}
|
|
53
|
-
|
|
54
78
|
// Operation Specifications
|
|
55
|
-
const serializer =
|
|
56
|
-
|
|
79
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
80
|
+
|
|
81
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
82
|
+
path:
|
|
83
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus",
|
|
57
84
|
httpMethod: "GET",
|
|
58
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus",
|
|
59
|
-
urlParameters: [
|
|
60
|
-
Parameters.subscriptionId
|
|
61
|
-
],
|
|
62
|
-
queryParameters: [
|
|
63
|
-
Parameters.apiVersion
|
|
64
|
-
],
|
|
65
|
-
headerParameters: [
|
|
66
|
-
Parameters.acceptLanguage
|
|
67
|
-
],
|
|
68
85
|
responses: {
|
|
69
86
|
200: {
|
|
70
87
|
bodyMapper: Mappers.SkuListResult
|
|
71
|
-
},
|
|
72
|
-
default: {
|
|
73
|
-
bodyMapper: Mappers.CloudError
|
|
74
88
|
}
|
|
75
89
|
},
|
|
90
|
+
queryParameters: [Parameters.apiVersion],
|
|
91
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
92
|
+
headerParameters: [Parameters.accept],
|
|
76
93
|
serializer
|
|
77
94
|
};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* license information.
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
5
4
|
*
|
|
6
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { UsageHistory } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
14
13
|
import * as Parameters from "../models/parameters";
|
|
15
|
-
import {
|
|
14
|
+
import { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
PlanUsageHistory,
|
|
17
|
+
UsageHistoryListNextOptionalParams,
|
|
18
|
+
UsageHistoryListOptionalParams,
|
|
19
|
+
UsageHistoryListResponse,
|
|
20
|
+
UsageHistoryListNextResponse
|
|
21
|
+
} from "../models";
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing UsageHistory operations. */
|
|
25
|
+
export class UsageHistoryImpl implements UsageHistory {
|
|
26
|
+
private readonly client: AzureMLCommitmentPlansManagementClient;
|
|
20
27
|
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
29
|
+
* Initialize a new instance of the class UsageHistory class.
|
|
30
|
+
* @param client Reference to the service client
|
|
24
31
|
*/
|
|
25
|
-
constructor(client:
|
|
32
|
+
constructor(client: AzureMLCommitmentPlansManagementClient) {
|
|
26
33
|
this.client = client;
|
|
27
34
|
}
|
|
28
35
|
|
|
@@ -30,108 +37,147 @@ export class UsageHistory {
|
|
|
30
37
|
* Retrieve the usage history for an Azure ML commitment plan.
|
|
31
38
|
* @param resourceGroupName The resource group name.
|
|
32
39
|
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
33
|
-
* @param
|
|
34
|
-
* @returns Promise<Models.UsageHistoryListResponse>
|
|
40
|
+
* @param options The options parameters.
|
|
35
41
|
*/
|
|
36
|
-
list(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
public list(
|
|
43
|
+
resourceGroupName: string,
|
|
44
|
+
commitmentPlanName: string,
|
|
45
|
+
options?: UsageHistoryListOptionalParams
|
|
46
|
+
): PagedAsyncIterableIterator<PlanUsageHistory> {
|
|
47
|
+
const iter = this.listPagingAll(
|
|
48
|
+
resourceGroupName,
|
|
49
|
+
commitmentPlanName,
|
|
50
|
+
options
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
next() {
|
|
54
|
+
return iter.next();
|
|
55
|
+
},
|
|
56
|
+
[Symbol.asyncIterator]() {
|
|
57
|
+
return this;
|
|
58
|
+
},
|
|
59
|
+
byPage: () => {
|
|
60
|
+
return this.listPagingPage(
|
|
61
|
+
resourceGroupName,
|
|
62
|
+
commitmentPlanName,
|
|
63
|
+
options
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private async *listPagingPage(
|
|
70
|
+
resourceGroupName: string,
|
|
71
|
+
commitmentPlanName: string,
|
|
72
|
+
options?: UsageHistoryListOptionalParams
|
|
73
|
+
): AsyncIterableIterator<PlanUsageHistory[]> {
|
|
74
|
+
let result = await this._list(
|
|
75
|
+
resourceGroupName,
|
|
76
|
+
commitmentPlanName,
|
|
77
|
+
options
|
|
78
|
+
);
|
|
79
|
+
yield result.value || [];
|
|
80
|
+
let continuationToken = result.nextLink;
|
|
81
|
+
while (continuationToken) {
|
|
82
|
+
result = await this._listNext(
|
|
53
83
|
resourceGroupName,
|
|
54
84
|
commitmentPlanName,
|
|
85
|
+
continuationToken,
|
|
55
86
|
options
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
87
|
+
);
|
|
88
|
+
continuationToken = result.nextLink;
|
|
89
|
+
yield result.value || [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private async *listPagingAll(
|
|
94
|
+
resourceGroupName: string,
|
|
95
|
+
commitmentPlanName: string,
|
|
96
|
+
options?: UsageHistoryListOptionalParams
|
|
97
|
+
): AsyncIterableIterator<PlanUsageHistory> {
|
|
98
|
+
for await (const page of this.listPagingPage(
|
|
99
|
+
resourceGroupName,
|
|
100
|
+
commitmentPlanName,
|
|
101
|
+
options
|
|
102
|
+
)) {
|
|
103
|
+
yield* page;
|
|
104
|
+
}
|
|
59
105
|
}
|
|
60
106
|
|
|
61
107
|
/**
|
|
62
108
|
* Retrieve the usage history for an Azure ML commitment plan.
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
66
|
-
*/
|
|
67
|
-
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.UsageHistoryListNextResponse>;
|
|
68
|
-
/**
|
|
69
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
70
|
-
* @param callback The callback
|
|
109
|
+
* @param resourceGroupName The resource group name.
|
|
110
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
111
|
+
* @param options The options parameters.
|
|
71
112
|
*/
|
|
72
|
-
|
|
113
|
+
private _list(
|
|
114
|
+
resourceGroupName: string,
|
|
115
|
+
commitmentPlanName: string,
|
|
116
|
+
options?: UsageHistoryListOptionalParams
|
|
117
|
+
): Promise<UsageHistoryListResponse> {
|
|
118
|
+
return this.client.sendOperationRequest(
|
|
119
|
+
{ resourceGroupName, commitmentPlanName, options },
|
|
120
|
+
listOperationSpec
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
73
124
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
125
|
+
* ListNext
|
|
126
|
+
* @param resourceGroupName The resource group name.
|
|
127
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
128
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
129
|
+
* @param options The options parameters.
|
|
77
130
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
131
|
+
private _listNext(
|
|
132
|
+
resourceGroupName: string,
|
|
133
|
+
commitmentPlanName: string,
|
|
134
|
+
nextLink: string,
|
|
135
|
+
options?: UsageHistoryListNextOptionalParams
|
|
136
|
+
): Promise<UsageHistoryListNextResponse> {
|
|
80
137
|
return this.client.sendOperationRequest(
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
listNextOperationSpec,
|
|
86
|
-
callback) as Promise<Models.UsageHistoryListNextResponse>;
|
|
138
|
+
{ resourceGroupName, commitmentPlanName, nextLink, options },
|
|
139
|
+
listNextOperationSpec
|
|
140
|
+
);
|
|
87
141
|
}
|
|
88
142
|
}
|
|
89
|
-
|
|
90
143
|
// Operation Specifications
|
|
91
|
-
const serializer =
|
|
92
|
-
|
|
144
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
145
|
+
|
|
146
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
147
|
+
path:
|
|
148
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory",
|
|
93
149
|
httpMethod: "GET",
|
|
94
|
-
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory",
|
|
95
|
-
urlParameters: [
|
|
96
|
-
Parameters.subscriptionId,
|
|
97
|
-
Parameters.resourceGroupName,
|
|
98
|
-
Parameters.commitmentPlanName
|
|
99
|
-
],
|
|
100
|
-
queryParameters: [
|
|
101
|
-
Parameters.skipToken,
|
|
102
|
-
Parameters.apiVersion
|
|
103
|
-
],
|
|
104
|
-
headerParameters: [
|
|
105
|
-
Parameters.acceptLanguage
|
|
106
|
-
],
|
|
107
150
|
responses: {
|
|
108
151
|
200: {
|
|
109
152
|
bodyMapper: Mappers.PlanUsageHistoryListResult
|
|
110
|
-
},
|
|
111
|
-
default: {
|
|
112
|
-
bodyMapper: Mappers.CloudError
|
|
113
153
|
}
|
|
114
154
|
},
|
|
155
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
156
|
+
urlParameters: [
|
|
157
|
+
Parameters.$host,
|
|
158
|
+
Parameters.subscriptionId,
|
|
159
|
+
Parameters.resourceGroupName,
|
|
160
|
+
Parameters.commitmentPlanName
|
|
161
|
+
],
|
|
162
|
+
headerParameters: [Parameters.accept],
|
|
115
163
|
serializer
|
|
116
164
|
};
|
|
117
|
-
|
|
118
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
|
119
|
-
httpMethod: "GET",
|
|
120
|
-
baseUrl: "https://management.azure.com",
|
|
165
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
121
166
|
path: "{nextLink}",
|
|
122
|
-
|
|
123
|
-
Parameters.nextPageLink
|
|
124
|
-
],
|
|
125
|
-
headerParameters: [
|
|
126
|
-
Parameters.acceptLanguage
|
|
127
|
-
],
|
|
167
|
+
httpMethod: "GET",
|
|
128
168
|
responses: {
|
|
129
169
|
200: {
|
|
130
170
|
bodyMapper: Mappers.PlanUsageHistoryListResult
|
|
131
|
-
},
|
|
132
|
-
default: {
|
|
133
|
-
bodyMapper: Mappers.CloudError
|
|
134
171
|
}
|
|
135
172
|
},
|
|
173
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
174
|
+
urlParameters: [
|
|
175
|
+
Parameters.$host,
|
|
176
|
+
Parameters.subscriptionId,
|
|
177
|
+
Parameters.resourceGroupName,
|
|
178
|
+
Parameters.commitmentPlanName,
|
|
179
|
+
Parameters.nextLink
|
|
180
|
+
],
|
|
181
|
+
headerParameters: [Parameters.accept],
|
|
136
182
|
serializer
|
|
137
183
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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 {
|
|
11
|
+
CommitmentAssociation,
|
|
12
|
+
CommitmentAssociationsListOptionalParams,
|
|
13
|
+
CommitmentAssociationsGetOptionalParams,
|
|
14
|
+
CommitmentAssociationsGetResponse,
|
|
15
|
+
MoveCommitmentAssociationRequest,
|
|
16
|
+
CommitmentAssociationsMoveOptionalParams,
|
|
17
|
+
CommitmentAssociationsMoveResponse
|
|
18
|
+
} from "../models";
|
|
19
|
+
|
|
20
|
+
/// <reference lib="esnext.asynciterable" />
|
|
21
|
+
/** Interface representing a CommitmentAssociations. */
|
|
22
|
+
export interface CommitmentAssociations {
|
|
23
|
+
/**
|
|
24
|
+
* Get all commitment associations for a parent commitment plan.
|
|
25
|
+
* @param resourceGroupName The resource group name.
|
|
26
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
27
|
+
* @param options The options parameters.
|
|
28
|
+
*/
|
|
29
|
+
list(
|
|
30
|
+
resourceGroupName: string,
|
|
31
|
+
commitmentPlanName: string,
|
|
32
|
+
options?: CommitmentAssociationsListOptionalParams
|
|
33
|
+
): PagedAsyncIterableIterator<CommitmentAssociation>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a commitment association.
|
|
36
|
+
* @param resourceGroupName The resource group name.
|
|
37
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
38
|
+
* @param commitmentAssociationName The commitment association name.
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
get(
|
|
42
|
+
resourceGroupName: string,
|
|
43
|
+
commitmentPlanName: string,
|
|
44
|
+
commitmentAssociationName: string,
|
|
45
|
+
options?: CommitmentAssociationsGetOptionalParams
|
|
46
|
+
): Promise<CommitmentAssociationsGetResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Re-parent a commitment association from one commitment plan to another.
|
|
49
|
+
* @param resourceGroupName The resource group name.
|
|
50
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
51
|
+
* @param commitmentAssociationName The commitment association name.
|
|
52
|
+
* @param movePayload The move request payload.
|
|
53
|
+
* @param options The options parameters.
|
|
54
|
+
*/
|
|
55
|
+
move(
|
|
56
|
+
resourceGroupName: string,
|
|
57
|
+
commitmentPlanName: string,
|
|
58
|
+
commitmentAssociationName: string,
|
|
59
|
+
movePayload: MoveCommitmentAssociationRequest,
|
|
60
|
+
options?: CommitmentAssociationsMoveOptionalParams
|
|
61
|
+
): Promise<CommitmentAssociationsMoveResponse>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 {
|
|
11
|
+
CommitmentPlan,
|
|
12
|
+
CommitmentPlansListOptionalParams,
|
|
13
|
+
CommitmentPlansListInResourceGroupOptionalParams,
|
|
14
|
+
CommitmentPlansGetOptionalParams,
|
|
15
|
+
CommitmentPlansGetResponse,
|
|
16
|
+
CommitmentPlansCreateOrUpdateOptionalParams,
|
|
17
|
+
CommitmentPlansCreateOrUpdateResponse,
|
|
18
|
+
CommitmentPlansRemoveOptionalParams,
|
|
19
|
+
CommitmentPlanPatchPayload,
|
|
20
|
+
CommitmentPlansPatchOptionalParams,
|
|
21
|
+
CommitmentPlansPatchResponse
|
|
22
|
+
} from "../models";
|
|
23
|
+
|
|
24
|
+
/// <reference lib="esnext.asynciterable" />
|
|
25
|
+
/** Interface representing a CommitmentPlans. */
|
|
26
|
+
export interface CommitmentPlans {
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve all Azure ML commitment plans in a subscription.
|
|
29
|
+
* @param options The options parameters.
|
|
30
|
+
*/
|
|
31
|
+
list(
|
|
32
|
+
options?: CommitmentPlansListOptionalParams
|
|
33
|
+
): PagedAsyncIterableIterator<CommitmentPlan>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve all Azure ML commitment plans in a resource group.
|
|
36
|
+
* @param resourceGroupName The resource group name.
|
|
37
|
+
* @param options The options parameters.
|
|
38
|
+
*/
|
|
39
|
+
listInResourceGroup(
|
|
40
|
+
resourceGroupName: string,
|
|
41
|
+
options?: CommitmentPlansListInResourceGroupOptionalParams
|
|
42
|
+
): PagedAsyncIterableIterator<CommitmentPlan>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve an Azure ML commitment plan by its subscription, resource group and name.
|
|
45
|
+
* @param resourceGroupName The resource group name.
|
|
46
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
47
|
+
* @param options The options parameters.
|
|
48
|
+
*/
|
|
49
|
+
get(
|
|
50
|
+
resourceGroupName: string,
|
|
51
|
+
commitmentPlanName: string,
|
|
52
|
+
options?: CommitmentPlansGetOptionalParams
|
|
53
|
+
): Promise<CommitmentPlansGetResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new Azure ML commitment plan resource or updates an existing one.
|
|
56
|
+
* @param resourceGroupName The resource group name.
|
|
57
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
58
|
+
* @param createOrUpdatePayload The payload to create or update the Azure ML commitment plan.
|
|
59
|
+
* @param options The options parameters.
|
|
60
|
+
*/
|
|
61
|
+
createOrUpdate(
|
|
62
|
+
resourceGroupName: string,
|
|
63
|
+
commitmentPlanName: string,
|
|
64
|
+
createOrUpdatePayload: CommitmentPlan,
|
|
65
|
+
options?: CommitmentPlansCreateOrUpdateOptionalParams
|
|
66
|
+
): Promise<CommitmentPlansCreateOrUpdateResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Remove an existing Azure ML commitment plan.
|
|
69
|
+
* @param resourceGroupName The resource group name.
|
|
70
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
71
|
+
* @param options The options parameters.
|
|
72
|
+
*/
|
|
73
|
+
remove(
|
|
74
|
+
resourceGroupName: string,
|
|
75
|
+
commitmentPlanName: string,
|
|
76
|
+
options?: CommitmentPlansRemoveOptionalParams
|
|
77
|
+
): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Patch an existing Azure ML commitment plan resource.
|
|
80
|
+
* @param resourceGroupName The resource group name.
|
|
81
|
+
* @param commitmentPlanName The Azure ML commitment plan name.
|
|
82
|
+
* @param patchPayload The payload to use to patch the Azure ML commitment plan. Only tags and SKU may
|
|
83
|
+
* be modified on an existing commitment plan.
|
|
84
|
+
* @param options The options parameters.
|
|
85
|
+
*/
|
|
86
|
+
patch(
|
|
87
|
+
resourceGroupName: string,
|
|
88
|
+
commitmentPlanName: string,
|
|
89
|
+
patchPayload: CommitmentPlanPatchPayload,
|
|
90
|
+
options?: CommitmentPlansPatchOptionalParams
|
|
91
|
+
): Promise<CommitmentPlansPatchResponse>;
|
|
92
|
+
}
|