@azure/arm-cognitiveservices 5.2.0 → 7.0.0-alpha.20211202.3
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.txt → LICENSE} +2 -2
- package/README.md +72 -77
- package/dist/index.js +4800 -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/cognitiveServicesManagementClient.d.ts +42 -0
- package/dist-esm/src/cognitiveServicesManagementClient.d.ts.map +1 -0
- package/dist-esm/src/cognitiveServicesManagementClient.js +133 -0
- package/dist-esm/src/cognitiveServicesManagementClient.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/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +1310 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +128 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +68 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +1474 -738
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +26 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +199 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/accounts.d.ts +138 -0
- package/dist-esm/src/operations/accounts.d.ts.map +1 -0
- package/dist-esm/src/operations/accounts.js +628 -0
- package/dist-esm/src/operations/accounts.js.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts +76 -0
- package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentPlans.js +293 -0
- package/dist-esm/src/operations/commitmentPlans.js.map +1 -0
- package/dist-esm/src/operations/commitmentTiers.d.ts +35 -0
- package/dist-esm/src/operations/commitmentTiers.d.ts.map +1 -0
- package/dist-esm/src/operations/commitmentTiers.js +132 -0
- package/dist-esm/src/operations/commitmentTiers.js.map +1 -0
- package/dist-esm/src/operations/deletedAccounts.d.ts +57 -0
- package/dist-esm/src/operations/deletedAccounts.d.ts.map +1 -0
- package/dist-esm/src/operations/deletedAccounts.js +232 -0
- package/dist-esm/src/operations/deletedAccounts.js.map +1 -0
- package/dist-esm/src/operations/deployments.d.ts +81 -0
- package/dist-esm/src/operations/deployments.d.ts.map +1 -0
- package/dist-esm/src/operations/deployments.js +331 -0
- package/dist-esm/src/operations/deployments.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +4 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +17 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/privateEndpointConnections.d.ts +70 -0
- package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
- package/dist-esm/src/operations/privateEndpointConnections.js +271 -0
- package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
- package/dist-esm/src/operations/privateLinkResources.d.ts +20 -0
- package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
- package/dist-esm/src/operations/privateLinkResources.js +53 -0
- package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
- package/dist-esm/src/operations/resourceSkus.d.ts +32 -0
- package/dist-esm/src/operations/resourceSkus.d.ts.map +1 -0
- package/dist-esm/src/operations/resourceSkus.js +124 -0
- package/dist-esm/src/operations/resourceSkus.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts +102 -0
- package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
- package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +51 -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/commitmentTiers.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/commitmentTiers.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/commitmentTiers.js +9 -0
- package/dist-esm/src/operationsInterfaces/commitmentTiers.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts +36 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.js +9 -0
- package/dist-esm/src/operationsInterfaces/deletedAccounts.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/deployments.d.ts +56 -0
- package/dist-esm/src/operationsInterfaces/deployments.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/deployments.js +9 -0
- package/dist-esm/src/operationsInterfaces/deployments.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +10 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +17 -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/privateEndpointConnections.d.ts +62 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.js +9 -0
- package/dist-esm/src/operationsInterfaces/resourceSkus.js.map +1 -0
- package/dist-esm/test/cognitiveservices_examples.d.ts +4 -0
- package/dist-esm/test/cognitiveservices_examples.d.ts.map +1 -0
- package/dist-esm/test/cognitiveservices_examples.js +127 -0
- package/dist-esm/test/cognitiveservices_examples.js.map +1 -0
- package/package.json +65 -21
- package/review/arm-cognitiveservices.api.md +1150 -0
- package/rollup.config.js +181 -30
- package/src/cognitiveServicesManagementClient.ts +163 -142
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1223 -1103
- package/src/models/mappers.ts +1513 -736
- package/src/models/parameters.ts +162 -47
- package/src/operations/accounts.ts +610 -495
- package/src/operations/commitmentPlans.ts +394 -0
- package/src/operations/commitmentTiers.ts +158 -0
- package/src/operations/deletedAccounts.ts +298 -0
- package/src/operations/deployments.ts +464 -0
- package/src/operations/index.ts +7 -5
- package/src/operations/operations.ts +91 -77
- package/src/operations/privateEndpointConnections.ts +281 -134
- package/src/operations/privateLinkResources.ts +40 -55
- package/src/operations/resourceSkus.ts +96 -80
- package/src/operationsInterfaces/accounts.ts +195 -0
- package/src/operationsInterfaces/commitmentPlans.ts +93 -0
- package/src/operationsInterfaces/commitmentTiers.ts +24 -0
- package/src/operationsInterfaces/deletedAccounts.ts +68 -0
- package/src/operationsInterfaces/deployments.ts +109 -0
- package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +8 -6
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/privateEndpointConnections.ts +115 -0
- package/src/operationsInterfaces/privateLinkResources.ts +27 -0
- package/src/operationsInterfaces/resourceSkus.ts +22 -0
- package/tsconfig.json +3 -3
- package/types/arm-cognitiveservices.d.ts +1860 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-cognitiveservices.js +0 -2719
- package/dist/arm-cognitiveservices.js.map +0 -1
- package/dist/arm-cognitiveservices.min.js +0 -1
- package/dist/arm-cognitiveservices.min.js.map +0 -1
- package/esm/cognitiveServicesManagementClient.d.ts +0 -70
- package/esm/cognitiveServicesManagementClient.d.ts.map +0 -1
- package/esm/cognitiveServicesManagementClient.js +0 -116
- package/esm/cognitiveServicesManagementClient.js.map +0 -1
- package/esm/cognitiveServicesManagementClientContext.d.ts +0 -16
- package/esm/cognitiveServicesManagementClientContext.d.ts.map +0 -1
- package/esm/cognitiveServicesManagementClientContext.js +0 -56
- package/esm/cognitiveServicesManagementClientContext.js.map +0 -1
- package/esm/models/accountsMappers.d.ts +0 -2
- package/esm/models/accountsMappers.d.ts.map +0 -1
- package/esm/models/accountsMappers.js +0 -9
- package/esm/models/accountsMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -1277
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -8
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -50
- 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 +0 -9
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -11
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -119
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.d.ts +0 -2
- package/esm/models/privateEndpointConnectionsMappers.d.ts.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.js +0 -9
- package/esm/models/privateEndpointConnectionsMappers.js.map +0 -1
- package/esm/models/privateLinkResourcesMappers.d.ts +0 -2
- package/esm/models/privateLinkResourcesMappers.d.ts.map +0 -1
- package/esm/models/privateLinkResourcesMappers.js +0 -9
- package/esm/models/privateLinkResourcesMappers.js.map +0 -1
- package/esm/models/resourceSkusMappers.d.ts +0 -2
- package/esm/models/resourceSkusMappers.d.ts.map +0 -1
- package/esm/models/resourceSkusMappers.js +0 -9
- package/esm/models/resourceSkusMappers.js.map +0 -1
- package/esm/operations/accounts.d.ts +0 -260
- package/esm/operations/accounts.d.ts.map +0 -1
- package/esm/operations/accounts.js +0 -411
- package/esm/operations/accounts.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 -46
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -77
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/privateEndpointConnections.d.ts +0 -99
- package/esm/operations/privateEndpointConnections.d.ts.map +0 -1
- package/esm/operations/privateEndpointConnections.js +0 -131
- package/esm/operations/privateEndpointConnections.js.map +0 -1
- package/esm/operations/privateLinkResources.d.ts +0 -34
- package/esm/operations/privateLinkResources.d.ts.map +0 -1
- package/esm/operations/privateLinkResources.js +0 -58
- package/esm/operations/privateLinkResources.js.map +0 -1
- package/esm/operations/resourceSkus.d.ts +0 -46
- package/esm/operations/resourceSkus.d.ts.map +0 -1
- package/esm/operations/resourceSkus.js +0 -80
- package/esm/operations/resourceSkus.js.map +0 -1
- package/src/cognitiveServicesManagementClientContext.ts +0 -62
- package/src/models/accountsMappers.ts +0 -44
- package/src/models/operationsMappers.ts +0 -14
- package/src/models/privateEndpointConnectionsMappers.ts +0 -35
- package/src/models/privateLinkResourcesMappers.ts +0 -36
- package/src/models/resourceSkusMappers.ts +0 -15
|
@@ -0,0 +1,394 @@
|
|
|
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 { CommitmentPlans } 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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
|
|
15
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
16
|
+
import { LroImpl } from "../lroImpl";
|
|
17
|
+
import {
|
|
18
|
+
CommitmentPlan,
|
|
19
|
+
CommitmentPlansListNextOptionalParams,
|
|
20
|
+
CommitmentPlansListOptionalParams,
|
|
21
|
+
CommitmentPlansListResponse,
|
|
22
|
+
CommitmentPlansGetOptionalParams,
|
|
23
|
+
CommitmentPlansGetResponse,
|
|
24
|
+
CommitmentPlansCreateOrUpdateOptionalParams,
|
|
25
|
+
CommitmentPlansCreateOrUpdateResponse,
|
|
26
|
+
CommitmentPlansDeleteOptionalParams,
|
|
27
|
+
CommitmentPlansListNextResponse
|
|
28
|
+
} from "../models";
|
|
29
|
+
|
|
30
|
+
/// <reference lib="esnext.asynciterable" />
|
|
31
|
+
/** Class containing CommitmentPlans operations. */
|
|
32
|
+
export class CommitmentPlansImpl implements CommitmentPlans {
|
|
33
|
+
private readonly client: CognitiveServicesManagementClient;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Initialize a new instance of the class CommitmentPlans class.
|
|
37
|
+
* @param client Reference to the service client
|
|
38
|
+
*/
|
|
39
|
+
constructor(client: CognitiveServicesManagementClient) {
|
|
40
|
+
this.client = client;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the commitmentPlans associated with the Cognitive Services account.
|
|
45
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
46
|
+
* @param accountName The name of Cognitive Services account.
|
|
47
|
+
* @param options The options parameters.
|
|
48
|
+
*/
|
|
49
|
+
public list(
|
|
50
|
+
resourceGroupName: string,
|
|
51
|
+
accountName: string,
|
|
52
|
+
options?: CommitmentPlansListOptionalParams
|
|
53
|
+
): PagedAsyncIterableIterator<CommitmentPlan> {
|
|
54
|
+
const iter = this.listPagingAll(resourceGroupName, accountName, options);
|
|
55
|
+
return {
|
|
56
|
+
next() {
|
|
57
|
+
return iter.next();
|
|
58
|
+
},
|
|
59
|
+
[Symbol.asyncIterator]() {
|
|
60
|
+
return this;
|
|
61
|
+
},
|
|
62
|
+
byPage: () => {
|
|
63
|
+
return this.listPagingPage(resourceGroupName, accountName, options);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private async *listPagingPage(
|
|
69
|
+
resourceGroupName: string,
|
|
70
|
+
accountName: string,
|
|
71
|
+
options?: CommitmentPlansListOptionalParams
|
|
72
|
+
): AsyncIterableIterator<CommitmentPlan[]> {
|
|
73
|
+
let result = await this._list(resourceGroupName, accountName, options);
|
|
74
|
+
yield result.value || [];
|
|
75
|
+
let continuationToken = result.nextLink;
|
|
76
|
+
while (continuationToken) {
|
|
77
|
+
result = await this._listNext(
|
|
78
|
+
resourceGroupName,
|
|
79
|
+
accountName,
|
|
80
|
+
continuationToken,
|
|
81
|
+
options
|
|
82
|
+
);
|
|
83
|
+
continuationToken = result.nextLink;
|
|
84
|
+
yield result.value || [];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private async *listPagingAll(
|
|
89
|
+
resourceGroupName: string,
|
|
90
|
+
accountName: string,
|
|
91
|
+
options?: CommitmentPlansListOptionalParams
|
|
92
|
+
): AsyncIterableIterator<CommitmentPlan> {
|
|
93
|
+
for await (const page of this.listPagingPage(
|
|
94
|
+
resourceGroupName,
|
|
95
|
+
accountName,
|
|
96
|
+
options
|
|
97
|
+
)) {
|
|
98
|
+
yield* page;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Gets the commitmentPlans associated with the Cognitive Services account.
|
|
104
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
105
|
+
* @param accountName The name of Cognitive Services account.
|
|
106
|
+
* @param options The options parameters.
|
|
107
|
+
*/
|
|
108
|
+
private _list(
|
|
109
|
+
resourceGroupName: string,
|
|
110
|
+
accountName: string,
|
|
111
|
+
options?: CommitmentPlansListOptionalParams
|
|
112
|
+
): Promise<CommitmentPlansListResponse> {
|
|
113
|
+
return this.client.sendOperationRequest(
|
|
114
|
+
{ resourceGroupName, accountName, options },
|
|
115
|
+
listOperationSpec
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Gets the specified commitmentPlans associated with the Cognitive Services account.
|
|
121
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
122
|
+
* @param accountName The name of Cognitive Services account.
|
|
123
|
+
* @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
|
|
124
|
+
* Account
|
|
125
|
+
* @param options The options parameters.
|
|
126
|
+
*/
|
|
127
|
+
get(
|
|
128
|
+
resourceGroupName: string,
|
|
129
|
+
accountName: string,
|
|
130
|
+
commitmentPlanName: string,
|
|
131
|
+
options?: CommitmentPlansGetOptionalParams
|
|
132
|
+
): Promise<CommitmentPlansGetResponse> {
|
|
133
|
+
return this.client.sendOperationRequest(
|
|
134
|
+
{ resourceGroupName, accountName, commitmentPlanName, options },
|
|
135
|
+
getOperationSpec
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Update the state of specified commitmentPlans associated with the Cognitive Services account.
|
|
141
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
142
|
+
* @param accountName The name of Cognitive Services account.
|
|
143
|
+
* @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
|
|
144
|
+
* Account
|
|
145
|
+
* @param commitmentPlan The commitmentPlan properties.
|
|
146
|
+
* @param options The options parameters.
|
|
147
|
+
*/
|
|
148
|
+
createOrUpdate(
|
|
149
|
+
resourceGroupName: string,
|
|
150
|
+
accountName: string,
|
|
151
|
+
commitmentPlanName: string,
|
|
152
|
+
commitmentPlan: CommitmentPlan,
|
|
153
|
+
options?: CommitmentPlansCreateOrUpdateOptionalParams
|
|
154
|
+
): Promise<CommitmentPlansCreateOrUpdateResponse> {
|
|
155
|
+
return this.client.sendOperationRequest(
|
|
156
|
+
{
|
|
157
|
+
resourceGroupName,
|
|
158
|
+
accountName,
|
|
159
|
+
commitmentPlanName,
|
|
160
|
+
commitmentPlan,
|
|
161
|
+
options
|
|
162
|
+
},
|
|
163
|
+
createOrUpdateOperationSpec
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Deletes the specified commitmentPlan associated with the Cognitive Services account.
|
|
169
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
170
|
+
* @param accountName The name of Cognitive Services account.
|
|
171
|
+
* @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
|
|
172
|
+
* Account
|
|
173
|
+
* @param options The options parameters.
|
|
174
|
+
*/
|
|
175
|
+
async beginDelete(
|
|
176
|
+
resourceGroupName: string,
|
|
177
|
+
accountName: string,
|
|
178
|
+
commitmentPlanName: string,
|
|
179
|
+
options?: CommitmentPlansDeleteOptionalParams
|
|
180
|
+
): Promise<PollerLike<PollOperationState<void>, void>> {
|
|
181
|
+
const directSendOperation = async (
|
|
182
|
+
args: coreClient.OperationArguments,
|
|
183
|
+
spec: coreClient.OperationSpec
|
|
184
|
+
): Promise<void> => {
|
|
185
|
+
return this.client.sendOperationRequest(args, spec);
|
|
186
|
+
};
|
|
187
|
+
const sendOperation = async (
|
|
188
|
+
args: coreClient.OperationArguments,
|
|
189
|
+
spec: coreClient.OperationSpec
|
|
190
|
+
) => {
|
|
191
|
+
let currentRawResponse:
|
|
192
|
+
| coreClient.FullOperationResponse
|
|
193
|
+
| undefined = undefined;
|
|
194
|
+
const providedCallback = args.options?.onResponse;
|
|
195
|
+
const callback: coreClient.RawResponseCallback = (
|
|
196
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
197
|
+
flatResponse: unknown
|
|
198
|
+
) => {
|
|
199
|
+
currentRawResponse = rawResponse;
|
|
200
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
201
|
+
};
|
|
202
|
+
const updatedArgs = {
|
|
203
|
+
...args,
|
|
204
|
+
options: {
|
|
205
|
+
...args.options,
|
|
206
|
+
onResponse: callback
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
210
|
+
return {
|
|
211
|
+
flatResponse,
|
|
212
|
+
rawResponse: {
|
|
213
|
+
statusCode: currentRawResponse!.status,
|
|
214
|
+
body: currentRawResponse!.parsedBody,
|
|
215
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const lro = new LroImpl(
|
|
221
|
+
sendOperation,
|
|
222
|
+
{ resourceGroupName, accountName, commitmentPlanName, options },
|
|
223
|
+
deleteOperationSpec
|
|
224
|
+
);
|
|
225
|
+
return new LroEngine(lro, {
|
|
226
|
+
resumeFrom: options?.resumeFrom,
|
|
227
|
+
intervalInMs: options?.updateIntervalInMs
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Deletes the specified commitmentPlan associated with the Cognitive Services account.
|
|
233
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
234
|
+
* @param accountName The name of Cognitive Services account.
|
|
235
|
+
* @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
|
|
236
|
+
* Account
|
|
237
|
+
* @param options The options parameters.
|
|
238
|
+
*/
|
|
239
|
+
async beginDeleteAndWait(
|
|
240
|
+
resourceGroupName: string,
|
|
241
|
+
accountName: string,
|
|
242
|
+
commitmentPlanName: string,
|
|
243
|
+
options?: CommitmentPlansDeleteOptionalParams
|
|
244
|
+
): Promise<void> {
|
|
245
|
+
const poller = await this.beginDelete(
|
|
246
|
+
resourceGroupName,
|
|
247
|
+
accountName,
|
|
248
|
+
commitmentPlanName,
|
|
249
|
+
options
|
|
250
|
+
);
|
|
251
|
+
return poller.pollUntilDone();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* ListNext
|
|
256
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
257
|
+
* @param accountName The name of Cognitive Services account.
|
|
258
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
259
|
+
* @param options The options parameters.
|
|
260
|
+
*/
|
|
261
|
+
private _listNext(
|
|
262
|
+
resourceGroupName: string,
|
|
263
|
+
accountName: string,
|
|
264
|
+
nextLink: string,
|
|
265
|
+
options?: CommitmentPlansListNextOptionalParams
|
|
266
|
+
): Promise<CommitmentPlansListNextResponse> {
|
|
267
|
+
return this.client.sendOperationRequest(
|
|
268
|
+
{ resourceGroupName, accountName, nextLink, options },
|
|
269
|
+
listNextOperationSpec
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Operation Specifications
|
|
274
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
275
|
+
|
|
276
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
277
|
+
path:
|
|
278
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans",
|
|
279
|
+
httpMethod: "GET",
|
|
280
|
+
responses: {
|
|
281
|
+
200: {
|
|
282
|
+
bodyMapper: Mappers.CommitmentPlanListResult
|
|
283
|
+
},
|
|
284
|
+
default: {
|
|
285
|
+
bodyMapper: Mappers.ErrorResponse
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
queryParameters: [Parameters.apiVersion],
|
|
289
|
+
urlParameters: [
|
|
290
|
+
Parameters.$host,
|
|
291
|
+
Parameters.resourceGroupName,
|
|
292
|
+
Parameters.accountName,
|
|
293
|
+
Parameters.subscriptionId
|
|
294
|
+
],
|
|
295
|
+
headerParameters: [Parameters.accept],
|
|
296
|
+
serializer
|
|
297
|
+
};
|
|
298
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
299
|
+
path:
|
|
300
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
|
|
301
|
+
httpMethod: "GET",
|
|
302
|
+
responses: {
|
|
303
|
+
200: {
|
|
304
|
+
bodyMapper: Mappers.CommitmentPlan
|
|
305
|
+
},
|
|
306
|
+
default: {
|
|
307
|
+
bodyMapper: Mappers.ErrorResponse
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
queryParameters: [Parameters.apiVersion],
|
|
311
|
+
urlParameters: [
|
|
312
|
+
Parameters.$host,
|
|
313
|
+
Parameters.resourceGroupName,
|
|
314
|
+
Parameters.accountName,
|
|
315
|
+
Parameters.subscriptionId,
|
|
316
|
+
Parameters.commitmentPlanName
|
|
317
|
+
],
|
|
318
|
+
headerParameters: [Parameters.accept],
|
|
319
|
+
serializer
|
|
320
|
+
};
|
|
321
|
+
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
322
|
+
path:
|
|
323
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
|
|
324
|
+
httpMethod: "PUT",
|
|
325
|
+
responses: {
|
|
326
|
+
200: {
|
|
327
|
+
bodyMapper: Mappers.CommitmentPlan
|
|
328
|
+
},
|
|
329
|
+
201: {
|
|
330
|
+
bodyMapper: Mappers.CommitmentPlan
|
|
331
|
+
},
|
|
332
|
+
default: {
|
|
333
|
+
bodyMapper: Mappers.ErrorResponse
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
requestBody: Parameters.commitmentPlan,
|
|
337
|
+
queryParameters: [Parameters.apiVersion],
|
|
338
|
+
urlParameters: [
|
|
339
|
+
Parameters.$host,
|
|
340
|
+
Parameters.resourceGroupName,
|
|
341
|
+
Parameters.accountName,
|
|
342
|
+
Parameters.subscriptionId,
|
|
343
|
+
Parameters.commitmentPlanName
|
|
344
|
+
],
|
|
345
|
+
headerParameters: [Parameters.contentType, Parameters.accept],
|
|
346
|
+
mediaType: "json",
|
|
347
|
+
serializer
|
|
348
|
+
};
|
|
349
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
350
|
+
path:
|
|
351
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
|
|
352
|
+
httpMethod: "DELETE",
|
|
353
|
+
responses: {
|
|
354
|
+
200: {},
|
|
355
|
+
201: {},
|
|
356
|
+
202: {},
|
|
357
|
+
204: {},
|
|
358
|
+
default: {
|
|
359
|
+
bodyMapper: Mappers.ErrorResponse
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
queryParameters: [Parameters.apiVersion],
|
|
363
|
+
urlParameters: [
|
|
364
|
+
Parameters.$host,
|
|
365
|
+
Parameters.resourceGroupName,
|
|
366
|
+
Parameters.accountName,
|
|
367
|
+
Parameters.subscriptionId,
|
|
368
|
+
Parameters.commitmentPlanName
|
|
369
|
+
],
|
|
370
|
+
headerParameters: [Parameters.accept],
|
|
371
|
+
serializer
|
|
372
|
+
};
|
|
373
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
374
|
+
path: "{nextLink}",
|
|
375
|
+
httpMethod: "GET",
|
|
376
|
+
responses: {
|
|
377
|
+
200: {
|
|
378
|
+
bodyMapper: Mappers.CommitmentPlanListResult
|
|
379
|
+
},
|
|
380
|
+
default: {
|
|
381
|
+
bodyMapper: Mappers.ErrorResponse
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
queryParameters: [Parameters.apiVersion],
|
|
385
|
+
urlParameters: [
|
|
386
|
+
Parameters.$host,
|
|
387
|
+
Parameters.resourceGroupName,
|
|
388
|
+
Parameters.accountName,
|
|
389
|
+
Parameters.subscriptionId,
|
|
390
|
+
Parameters.nextLink
|
|
391
|
+
],
|
|
392
|
+
headerParameters: [Parameters.accept],
|
|
393
|
+
serializer
|
|
394
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
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 { CommitmentTiers } 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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
CommitmentTier,
|
|
17
|
+
CommitmentTiersListNextOptionalParams,
|
|
18
|
+
CommitmentTiersListOptionalParams,
|
|
19
|
+
CommitmentTiersListResponse,
|
|
20
|
+
CommitmentTiersListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing CommitmentTiers operations. */
|
|
25
|
+
export class CommitmentTiersImpl implements CommitmentTiers {
|
|
26
|
+
private readonly client: CognitiveServicesManagementClient;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class CommitmentTiers class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: CognitiveServicesManagementClient) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List Commitment Tiers.
|
|
38
|
+
* @param location Resource location.
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
location: string,
|
|
43
|
+
options?: CommitmentTiersListOptionalParams
|
|
44
|
+
): PagedAsyncIterableIterator<CommitmentTier> {
|
|
45
|
+
const iter = this.listPagingAll(location, options);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
},
|
|
53
|
+
byPage: () => {
|
|
54
|
+
return this.listPagingPage(location, options);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private async *listPagingPage(
|
|
60
|
+
location: string,
|
|
61
|
+
options?: CommitmentTiersListOptionalParams
|
|
62
|
+
): AsyncIterableIterator<CommitmentTier[]> {
|
|
63
|
+
let result = await this._list(location, options);
|
|
64
|
+
yield result.value || [];
|
|
65
|
+
let continuationToken = result.nextLink;
|
|
66
|
+
while (continuationToken) {
|
|
67
|
+
result = await this._listNext(location, continuationToken, options);
|
|
68
|
+
continuationToken = result.nextLink;
|
|
69
|
+
yield result.value || [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private async *listPagingAll(
|
|
74
|
+
location: string,
|
|
75
|
+
options?: CommitmentTiersListOptionalParams
|
|
76
|
+
): AsyncIterableIterator<CommitmentTier> {
|
|
77
|
+
for await (const page of this.listPagingPage(location, options)) {
|
|
78
|
+
yield* page;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* List Commitment Tiers.
|
|
84
|
+
* @param location Resource location.
|
|
85
|
+
* @param options The options parameters.
|
|
86
|
+
*/
|
|
87
|
+
private _list(
|
|
88
|
+
location: string,
|
|
89
|
+
options?: CommitmentTiersListOptionalParams
|
|
90
|
+
): Promise<CommitmentTiersListResponse> {
|
|
91
|
+
return this.client.sendOperationRequest(
|
|
92
|
+
{ location, options },
|
|
93
|
+
listOperationSpec
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* ListNext
|
|
99
|
+
* @param location Resource location.
|
|
100
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
101
|
+
* @param options The options parameters.
|
|
102
|
+
*/
|
|
103
|
+
private _listNext(
|
|
104
|
+
location: string,
|
|
105
|
+
nextLink: string,
|
|
106
|
+
options?: CommitmentTiersListNextOptionalParams
|
|
107
|
+
): Promise<CommitmentTiersListNextResponse> {
|
|
108
|
+
return this.client.sendOperationRequest(
|
|
109
|
+
{ location, nextLink, options },
|
|
110
|
+
listNextOperationSpec
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Operation Specifications
|
|
115
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
116
|
+
|
|
117
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
118
|
+
path:
|
|
119
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers",
|
|
120
|
+
httpMethod: "GET",
|
|
121
|
+
responses: {
|
|
122
|
+
200: {
|
|
123
|
+
bodyMapper: Mappers.CommitmentTierListResult
|
|
124
|
+
},
|
|
125
|
+
default: {
|
|
126
|
+
bodyMapper: Mappers.ErrorResponse
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
queryParameters: [Parameters.apiVersion],
|
|
130
|
+
urlParameters: [
|
|
131
|
+
Parameters.$host,
|
|
132
|
+
Parameters.subscriptionId,
|
|
133
|
+
Parameters.location
|
|
134
|
+
],
|
|
135
|
+
headerParameters: [Parameters.accept],
|
|
136
|
+
serializer
|
|
137
|
+
};
|
|
138
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
139
|
+
path: "{nextLink}",
|
|
140
|
+
httpMethod: "GET",
|
|
141
|
+
responses: {
|
|
142
|
+
200: {
|
|
143
|
+
bodyMapper: Mappers.CommitmentTierListResult
|
|
144
|
+
},
|
|
145
|
+
default: {
|
|
146
|
+
bodyMapper: Mappers.ErrorResponse
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
queryParameters: [Parameters.apiVersion],
|
|
150
|
+
urlParameters: [
|
|
151
|
+
Parameters.$host,
|
|
152
|
+
Parameters.subscriptionId,
|
|
153
|
+
Parameters.nextLink,
|
|
154
|
+
Parameters.location
|
|
155
|
+
],
|
|
156
|
+
headerParameters: [Parameters.accept],
|
|
157
|
+
serializer
|
|
158
|
+
};
|