@azure/arm-subscriptions 3.1.2 → 5.0.0
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 +58 -0
- package/{LICENSE.txt → LICENSE} +2 -2
- package/README.md +69 -79
- package/dist/index.js +2330 -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/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 +658 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +36 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +36 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +1057 -0
- 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 +121 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/alias.d.ts +53 -0
- package/dist-esm/src/operations/alias.d.ts.map +1 -0
- package/dist-esm/src/operations/alias.js +180 -0
- package/dist-esm/src/operations/alias.js.map +1 -0
- package/dist-esm/src/operations/billingAccount.d.ts +19 -0
- package/dist-esm/src/operations/billingAccount.d.ts.map +1 -0
- package/dist-esm/src/operations/billingAccount.js +47 -0
- package/dist-esm/src/operations/billingAccount.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +2 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +5 -5
- 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/subscriptionOperations.d.ts +53 -0
- package/dist-esm/src/operations/subscriptionOperations.d.ts.map +1 -0
- package/dist-esm/src/operations/subscriptionOperations.js +201 -0
- package/dist-esm/src/operations/subscriptionOperations.js.map +1 -0
- package/dist-esm/src/operations/subscriptionPolicy.d.ts +43 -0
- package/dist-esm/src/operations/subscriptionPolicy.d.ts.map +1 -0
- package/dist-esm/src/operations/subscriptionPolicy.js +169 -0
- package/dist-esm/src/operations/subscriptionPolicy.js.map +1 -0
- package/dist-esm/src/operations/subscriptions.d.ts +54 -0
- package/dist-esm/src/operations/subscriptions.d.ts.map +1 -0
- package/dist-esm/src/operations/subscriptions.js +201 -0
- package/dist-esm/src/operations/subscriptions.js.map +1 -0
- package/dist-esm/src/operations/tenants.d.ts +32 -0
- package/dist-esm/src/operations/tenants.d.ts.map +1 -0
- package/dist-esm/src/operations/tenants.js +114 -0
- package/dist-esm/src/operations/tenants.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/alias.d.ts +45 -0
- package/dist-esm/src/operationsInterfaces/alias.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/alias.js +9 -0
- package/dist-esm/src/operationsInterfaces/alias.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/billingAccount.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/billingAccount.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/billingAccount.js +9 -0
- package/dist-esm/src/operationsInterfaces/billingAccount.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +15 -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/subscriptionOperations.d.ts +45 -0
- package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscriptionOperations.js +9 -0
- package/dist-esm/src/operationsInterfaces/subscriptionOperations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts +22 -0
- package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js +9 -0
- package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +24 -0
- package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscriptions.js +9 -0
- package/dist-esm/src/operationsInterfaces/subscriptions.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/tenants.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/tenants.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/tenants.js +9 -0
- package/dist-esm/src/operationsInterfaces/tenants.js.map +1 -0
- package/dist-esm/src/subscriptionClient.d.ts +21 -0
- package/dist-esm/src/subscriptionClient.d.ts.map +1 -0
- package/dist-esm/src/subscriptionClient.js +50 -0
- package/dist-esm/src/subscriptionClient.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 +65 -32
- package/review/arm-subscriptions.api.md +559 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +551 -489
- package/src/models/mappers.ts +685 -190
- package/src/models/parameters.ts +94 -27
- package/src/operations/alias.ts +170 -170
- package/src/operations/billingAccount.ts +65 -0
- package/src/operations/index.ts +5 -5
- package/src/operations/operations.ts +103 -40
- package/src/operations/subscriptionOperations.ts +216 -120
- package/src/operations/subscriptionPolicy.ts +207 -0
- package/src/operations/subscriptions.ts +163 -153
- package/src/operations/tenants.ts +87 -79
- package/src/operationsInterfaces/alias.ts +75 -0
- package/src/operationsInterfaces/billingAccount.ts +25 -0
- package/src/operationsInterfaces/index.ts +15 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/subscriptionOperations.ts +92 -0
- package/src/operationsInterfaces/subscriptionPolicy.ts +46 -0
- package/src/operationsInterfaces/subscriptions.ts +48 -0
- package/src/operationsInterfaces/tenants.ts +22 -0
- package/src/subscriptionClient.ts +81 -43
- package/tsconfig.json +3 -3
- package/types/arm-subscriptions.d.ts +925 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-subscriptions.js +0 -1442
- package/dist/arm-subscriptions.js.map +0 -1
- package/dist/arm-subscriptions.min.js +0 -1
- package/dist/arm-subscriptions.min.js.map +0 -1
- package/esm/models/aliasMappers.d.ts +0 -2
- package/esm/models/aliasMappers.d.ts.map +0 -1
- package/esm/models/aliasMappers.js +0 -9
- package/esm/models/aliasMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -624
- 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 -25
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js +0 -574
- 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 -8
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -75
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/subscriptionOperationsMappers.d.ts +0 -2
- package/esm/models/subscriptionOperationsMappers.d.ts.map +0 -1
- package/esm/models/subscriptionOperationsMappers.js +0 -9
- package/esm/models/subscriptionOperationsMappers.js.map +0 -1
- package/esm/models/subscriptionsMappers.d.ts +0 -2
- package/esm/models/subscriptionsMappers.d.ts.map +0 -1
- package/esm/models/subscriptionsMappers.js +0 -9
- package/esm/models/subscriptionsMappers.js.map +0 -1
- package/esm/models/tenantsMappers.d.ts +0 -2
- package/esm/models/tenantsMappers.d.ts.map +0 -1
- package/esm/models/tenantsMappers.js +0 -9
- package/esm/models/tenantsMappers.js.map +0 -1
- package/esm/operations/alias.d.ts +0 -81
- package/esm/operations/alias.d.ts.map +0 -1
- package/esm/operations/alias.js +0 -161
- package/esm/operations/alias.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -28
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -51
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/subscriptionOperations.d.ts +0 -70
- package/esm/operations/subscriptionOperations.d.ts.map +0 -1
- package/esm/operations/subscriptionOperations.js +0 -117
- package/esm/operations/subscriptionOperations.js.map +0 -1
- package/esm/operations/subscriptions.d.ts +0 -84
- package/esm/operations/subscriptions.d.ts.map +0 -1
- package/esm/operations/subscriptions.js +0 -133
- package/esm/operations/subscriptions.js.map +0 -1
- package/esm/operations/tenants.d.ts +0 -46
- package/esm/operations/tenants.d.ts.map +0 -1
- package/esm/operations/tenants.js +0 -77
- package/esm/operations/tenants.js.map +0 -1
- package/esm/subscriptionClient.d.ts +0 -27
- package/esm/subscriptionClient.d.ts.map +0 -1
- package/esm/subscriptionClient.js +0 -41
- package/esm/subscriptionClient.js.map +0 -1
- package/esm/subscriptionClientContext.d.ts +0 -19
- package/esm/subscriptionClientContext.d.ts.map +0 -1
- package/esm/subscriptionClientContext.js +0 -55
- package/esm/subscriptionClientContext.js.map +0 -1
- package/src/models/aliasMappers.ts +0 -18
- package/src/models/operationsMappers.ts +0 -14
- package/src/models/subscriptionOperationsMappers.ts +0 -15
- package/src/models/subscriptionsMappers.ts +0 -16
- package/src/models/tenantsMappers.ts +0 -13
- package/src/subscriptionClientContext.ts +0 -60
|
@@ -1,74 +1,137 @@
|
|
|
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 { Operations } 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 { SubscriptionClient } from "../subscriptionClient";
|
|
15
|
+
import {
|
|
16
|
+
Operation,
|
|
17
|
+
OperationsListNextOptionalParams,
|
|
18
|
+
OperationsListOptionalParams,
|
|
19
|
+
OperationsListResponse,
|
|
20
|
+
OperationsListNextResponse
|
|
21
|
+
} from "../models";
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Operations operations. */
|
|
25
|
+
export class OperationsImpl implements Operations {
|
|
26
|
+
private readonly client: SubscriptionClient;
|
|
20
27
|
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
29
|
+
* Initialize a new instance of the class Operations class.
|
|
30
|
+
* @param client Reference to the service client
|
|
24
31
|
*/
|
|
25
|
-
constructor(client:
|
|
32
|
+
constructor(client: SubscriptionClient) {
|
|
26
33
|
this.client = client;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
37
|
* Lists all of the available Microsoft.Subscription API operations.
|
|
31
|
-
* @param
|
|
32
|
-
* @returns Promise<Models.OperationsListResponse>
|
|
38
|
+
* @param options The options parameters.
|
|
33
39
|
*/
|
|
34
|
-
list(
|
|
40
|
+
public list(
|
|
41
|
+
options?: OperationsListOptionalParams
|
|
42
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
43
|
+
const iter = this.listPagingAll(options);
|
|
44
|
+
return {
|
|
45
|
+
next() {
|
|
46
|
+
return iter.next();
|
|
47
|
+
},
|
|
48
|
+
[Symbol.asyncIterator]() {
|
|
49
|
+
return this;
|
|
50
|
+
},
|
|
51
|
+
byPage: () => {
|
|
52
|
+
return this.listPagingPage(options);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private async *listPagingPage(
|
|
58
|
+
options?: OperationsListOptionalParams
|
|
59
|
+
): AsyncIterableIterator<Operation[]> {
|
|
60
|
+
let result = await this._list(options);
|
|
61
|
+
yield result.value || [];
|
|
62
|
+
let continuationToken = result.nextLink;
|
|
63
|
+
while (continuationToken) {
|
|
64
|
+
result = await this._listNext(continuationToken, options);
|
|
65
|
+
continuationToken = result.nextLink;
|
|
66
|
+
yield result.value || [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private async *listPagingAll(
|
|
71
|
+
options?: OperationsListOptionalParams
|
|
72
|
+
): AsyncIterableIterator<Operation> {
|
|
73
|
+
for await (const page of this.listPagingPage(options)) {
|
|
74
|
+
yield* page;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
35
78
|
/**
|
|
36
|
-
*
|
|
79
|
+
* Lists all of the available Microsoft.Subscription API operations.
|
|
80
|
+
* @param options The options parameters.
|
|
37
81
|
*/
|
|
38
|
-
|
|
82
|
+
private _list(
|
|
83
|
+
options?: OperationsListOptionalParams
|
|
84
|
+
): Promise<OperationsListResponse> {
|
|
85
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
86
|
+
}
|
|
87
|
+
|
|
39
88
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param
|
|
89
|
+
* ListNext
|
|
90
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
91
|
+
* @param options The options parameters.
|
|
42
92
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
93
|
+
private _listNext(
|
|
94
|
+
nextLink: string,
|
|
95
|
+
options?: OperationsListNextOptionalParams
|
|
96
|
+
): Promise<OperationsListNextResponse> {
|
|
45
97
|
return this.client.sendOperationRequest(
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
listOperationSpec,
|
|
50
|
-
callback) as Promise<Models.OperationsListResponse>;
|
|
98
|
+
{ nextLink, options },
|
|
99
|
+
listNextOperationSpec
|
|
100
|
+
);
|
|
51
101
|
}
|
|
52
102
|
}
|
|
53
|
-
|
|
54
103
|
// Operation Specifications
|
|
55
|
-
const serializer =
|
|
56
|
-
|
|
104
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
105
|
+
|
|
106
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
107
|
+
path: "/providers/Microsoft.Subscription/operations",
|
|
108
|
+
httpMethod: "GET",
|
|
109
|
+
responses: {
|
|
110
|
+
200: {
|
|
111
|
+
bodyMapper: Mappers.OperationListResult
|
|
112
|
+
},
|
|
113
|
+
default: {
|
|
114
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
queryParameters: [Parameters.apiVersion1],
|
|
118
|
+
urlParameters: [Parameters.$host],
|
|
119
|
+
headerParameters: [Parameters.accept],
|
|
120
|
+
serializer
|
|
121
|
+
};
|
|
122
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
123
|
+
path: "{nextLink}",
|
|
57
124
|
httpMethod: "GET",
|
|
58
|
-
path: "providers/Microsoft.Subscription/operations",
|
|
59
|
-
queryParameters: [
|
|
60
|
-
Parameters.apiVersion1
|
|
61
|
-
],
|
|
62
|
-
headerParameters: [
|
|
63
|
-
Parameters.acceptLanguage
|
|
64
|
-
],
|
|
65
125
|
responses: {
|
|
66
126
|
200: {
|
|
67
127
|
bodyMapper: Mappers.OperationListResult
|
|
68
128
|
},
|
|
69
129
|
default: {
|
|
70
|
-
bodyMapper: Mappers.
|
|
130
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
71
131
|
}
|
|
72
132
|
},
|
|
133
|
+
queryParameters: [Parameters.apiVersion1],
|
|
134
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
135
|
+
headerParameters: [Parameters.accept],
|
|
73
136
|
serializer
|
|
74
137
|
};
|
|
@@ -1,194 +1,290 @@
|
|
|
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 * as
|
|
13
|
-
import * as Mappers from "../models/
|
|
9
|
+
import { SubscriptionOperations } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
14
12
|
import * as Parameters from "../models/parameters";
|
|
15
|
-
import {
|
|
13
|
+
import { SubscriptionClient } from "../subscriptionClient";
|
|
14
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
15
|
+
import { LroImpl } from "../lroImpl";
|
|
16
|
+
import {
|
|
17
|
+
SubscriptionCancelOptionalParams,
|
|
18
|
+
SubscriptionCancelResponse,
|
|
19
|
+
SubscriptionName,
|
|
20
|
+
SubscriptionRenameOptionalParams,
|
|
21
|
+
SubscriptionRenameResponse,
|
|
22
|
+
SubscriptionEnableOptionalParams,
|
|
23
|
+
SubscriptionEnableResponse,
|
|
24
|
+
AcceptOwnershipRequest,
|
|
25
|
+
SubscriptionAcceptOwnershipOptionalParams,
|
|
26
|
+
SubscriptionAcceptOwnershipResponse,
|
|
27
|
+
SubscriptionAcceptOwnershipStatusOptionalParams,
|
|
28
|
+
SubscriptionAcceptOwnershipStatusResponse
|
|
29
|
+
} from "../models";
|
|
16
30
|
|
|
17
|
-
/** Class
|
|
18
|
-
export class SubscriptionOperations {
|
|
19
|
-
private readonly client:
|
|
31
|
+
/** Class containing SubscriptionOperations operations. */
|
|
32
|
+
export class SubscriptionOperationsImpl implements SubscriptionOperations {
|
|
33
|
+
private readonly client: SubscriptionClient;
|
|
20
34
|
|
|
21
35
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
36
|
+
* Initialize a new instance of the class SubscriptionOperations class.
|
|
37
|
+
* @param client Reference to the service client
|
|
24
38
|
*/
|
|
25
|
-
constructor(client:
|
|
39
|
+
constructor(client: SubscriptionClient) {
|
|
26
40
|
this.client = client;
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
/**
|
|
30
44
|
* The operation to cancel a subscription
|
|
31
45
|
* @param subscriptionId Subscription Id.
|
|
32
|
-
* @param
|
|
33
|
-
* @returns Promise<Models.SubscriptionCancelResponse>
|
|
46
|
+
* @param options The options parameters.
|
|
34
47
|
*/
|
|
35
|
-
cancel(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
cancel(subscriptionId: string, callback: msRest.ServiceCallback<Models.CanceledSubscriptionId>): void;
|
|
41
|
-
/**
|
|
42
|
-
* @param subscriptionId Subscription Id.
|
|
43
|
-
* @param options The optional parameters
|
|
44
|
-
* @param callback The callback
|
|
45
|
-
*/
|
|
46
|
-
cancel(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CanceledSubscriptionId>): void;
|
|
47
|
-
cancel(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CanceledSubscriptionId>, callback?: msRest.ServiceCallback<Models.CanceledSubscriptionId>): Promise<Models.SubscriptionCancelResponse> {
|
|
48
|
+
cancel(
|
|
49
|
+
subscriptionId: string,
|
|
50
|
+
options?: SubscriptionCancelOptionalParams
|
|
51
|
+
): Promise<SubscriptionCancelResponse> {
|
|
48
52
|
return this.client.sendOperationRequest(
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
cancelOperationSpec,
|
|
54
|
-
callback) as Promise<Models.SubscriptionCancelResponse>;
|
|
53
|
+
{ subscriptionId, options },
|
|
54
|
+
cancelOperationSpec
|
|
55
|
+
);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* The operation to rename a subscription
|
|
59
60
|
* @param subscriptionId Subscription Id.
|
|
60
61
|
* @param body Subscription Name
|
|
61
|
-
* @param
|
|
62
|
-
* @returns Promise<Models.SubscriptionRenameResponse>
|
|
62
|
+
* @param options The options parameters.
|
|
63
63
|
*/
|
|
64
|
-
rename(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
rename(
|
|
65
|
+
subscriptionId: string,
|
|
66
|
+
body: SubscriptionName,
|
|
67
|
+
options?: SubscriptionRenameOptionalParams
|
|
68
|
+
): Promise<SubscriptionRenameResponse> {
|
|
69
|
+
return this.client.sendOperationRequest(
|
|
70
|
+
{ subscriptionId, body, options },
|
|
71
|
+
renameOperationSpec
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
71
75
|
/**
|
|
76
|
+
* The operation to enable a subscription
|
|
72
77
|
* @param subscriptionId Subscription Id.
|
|
73
|
-
* @param
|
|
74
|
-
* @param options The optional parameters
|
|
75
|
-
* @param callback The callback
|
|
78
|
+
* @param options The options parameters.
|
|
76
79
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
enable(
|
|
81
|
+
subscriptionId: string,
|
|
82
|
+
options?: SubscriptionEnableOptionalParams
|
|
83
|
+
): Promise<SubscriptionEnableResponse> {
|
|
79
84
|
return this.client.sendOperationRequest(
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
options
|
|
84
|
-
},
|
|
85
|
-
renameOperationSpec,
|
|
86
|
-
callback) as Promise<Models.SubscriptionRenameResponse>;
|
|
85
|
+
{ subscriptionId, options },
|
|
86
|
+
enableOperationSpec
|
|
87
|
+
);
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
+
* Accept subscription ownership.
|
|
91
92
|
* @param subscriptionId Subscription Id.
|
|
92
|
-
* @param
|
|
93
|
-
* @
|
|
93
|
+
* @param body The parameters required to accept subscription ownership.
|
|
94
|
+
* @param options The options parameters.
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
+
async beginAcceptOwnership(
|
|
97
|
+
subscriptionId: string,
|
|
98
|
+
body: AcceptOwnershipRequest,
|
|
99
|
+
options?: SubscriptionAcceptOwnershipOptionalParams
|
|
100
|
+
): Promise<
|
|
101
|
+
PollerLike<
|
|
102
|
+
PollOperationState<SubscriptionAcceptOwnershipResponse>,
|
|
103
|
+
SubscriptionAcceptOwnershipResponse
|
|
104
|
+
>
|
|
105
|
+
> {
|
|
106
|
+
const directSendOperation = async (
|
|
107
|
+
args: coreClient.OperationArguments,
|
|
108
|
+
spec: coreClient.OperationSpec
|
|
109
|
+
): Promise<SubscriptionAcceptOwnershipResponse> => {
|
|
110
|
+
return this.client.sendOperationRequest(args, spec);
|
|
111
|
+
};
|
|
112
|
+
const sendOperation = async (
|
|
113
|
+
args: coreClient.OperationArguments,
|
|
114
|
+
spec: coreClient.OperationSpec
|
|
115
|
+
) => {
|
|
116
|
+
let currentRawResponse:
|
|
117
|
+
| coreClient.FullOperationResponse
|
|
118
|
+
| undefined = undefined;
|
|
119
|
+
const providedCallback = args.options?.onResponse;
|
|
120
|
+
const callback: coreClient.RawResponseCallback = (
|
|
121
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
122
|
+
flatResponse: unknown
|
|
123
|
+
) => {
|
|
124
|
+
currentRawResponse = rawResponse;
|
|
125
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
126
|
+
};
|
|
127
|
+
const updatedArgs = {
|
|
128
|
+
...args,
|
|
129
|
+
options: {
|
|
130
|
+
...args.options,
|
|
131
|
+
onResponse: callback
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
135
|
+
return {
|
|
136
|
+
flatResponse,
|
|
137
|
+
rawResponse: {
|
|
138
|
+
statusCode: currentRawResponse!.status,
|
|
139
|
+
body: currentRawResponse!.parsedBody,
|
|
140
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const lro = new LroImpl(
|
|
146
|
+
sendOperation,
|
|
147
|
+
{ subscriptionId, body, options },
|
|
148
|
+
acceptOwnershipOperationSpec
|
|
149
|
+
);
|
|
150
|
+
return new LroEngine(lro, {
|
|
151
|
+
resumeFrom: options?.resumeFrom,
|
|
152
|
+
intervalInMs: options?.updateIntervalInMs
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
96
156
|
/**
|
|
157
|
+
* Accept subscription ownership.
|
|
97
158
|
* @param subscriptionId Subscription Id.
|
|
98
|
-
* @param
|
|
159
|
+
* @param body The parameters required to accept subscription ownership.
|
|
160
|
+
* @param options The options parameters.
|
|
99
161
|
*/
|
|
100
|
-
|
|
162
|
+
async beginAcceptOwnershipAndWait(
|
|
163
|
+
subscriptionId: string,
|
|
164
|
+
body: AcceptOwnershipRequest,
|
|
165
|
+
options?: SubscriptionAcceptOwnershipOptionalParams
|
|
166
|
+
): Promise<SubscriptionAcceptOwnershipResponse> {
|
|
167
|
+
const poller = await this.beginAcceptOwnership(
|
|
168
|
+
subscriptionId,
|
|
169
|
+
body,
|
|
170
|
+
options
|
|
171
|
+
);
|
|
172
|
+
return poller.pollUntilDone();
|
|
173
|
+
}
|
|
174
|
+
|
|
101
175
|
/**
|
|
176
|
+
* Accept subscription ownership status.
|
|
102
177
|
* @param subscriptionId Subscription Id.
|
|
103
|
-
* @param options The
|
|
104
|
-
* @param callback The callback
|
|
178
|
+
* @param options The options parameters.
|
|
105
179
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
180
|
+
acceptOwnershipStatus(
|
|
181
|
+
subscriptionId: string,
|
|
182
|
+
options?: SubscriptionAcceptOwnershipStatusOptionalParams
|
|
183
|
+
): Promise<SubscriptionAcceptOwnershipStatusResponse> {
|
|
108
184
|
return this.client.sendOperationRequest(
|
|
109
|
-
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
enableOperationSpec,
|
|
114
|
-
callback) as Promise<Models.SubscriptionEnableResponse>;
|
|
185
|
+
{ subscriptionId, options },
|
|
186
|
+
acceptOwnershipStatusOperationSpec
|
|
187
|
+
);
|
|
115
188
|
}
|
|
116
189
|
}
|
|
117
|
-
|
|
118
190
|
// Operation Specifications
|
|
119
|
-
const serializer =
|
|
120
|
-
|
|
191
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
192
|
+
|
|
193
|
+
const cancelOperationSpec: coreClient.OperationSpec = {
|
|
194
|
+
path:
|
|
195
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
|
|
121
196
|
httpMethod: "POST",
|
|
122
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
|
|
123
|
-
urlParameters: [
|
|
124
|
-
Parameters.subscriptionId
|
|
125
|
-
],
|
|
126
|
-
queryParameters: [
|
|
127
|
-
Parameters.apiVersion1
|
|
128
|
-
],
|
|
129
|
-
headerParameters: [
|
|
130
|
-
Parameters.acceptLanguage
|
|
131
|
-
],
|
|
132
197
|
responses: {
|
|
133
198
|
200: {
|
|
134
199
|
bodyMapper: Mappers.CanceledSubscriptionId
|
|
135
200
|
},
|
|
136
201
|
default: {
|
|
137
|
-
bodyMapper: Mappers.
|
|
202
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
138
203
|
}
|
|
139
204
|
},
|
|
205
|
+
queryParameters: [Parameters.apiVersion1],
|
|
206
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
207
|
+
headerParameters: [Parameters.accept],
|
|
140
208
|
serializer
|
|
141
209
|
};
|
|
142
|
-
|
|
143
|
-
|
|
210
|
+
const renameOperationSpec: coreClient.OperationSpec = {
|
|
211
|
+
path:
|
|
212
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
|
|
144
213
|
httpMethod: "POST",
|
|
145
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
|
|
146
|
-
urlParameters: [
|
|
147
|
-
Parameters.subscriptionId
|
|
148
|
-
],
|
|
149
|
-
queryParameters: [
|
|
150
|
-
Parameters.apiVersion1
|
|
151
|
-
],
|
|
152
|
-
headerParameters: [
|
|
153
|
-
Parameters.acceptLanguage
|
|
154
|
-
],
|
|
155
|
-
requestBody: {
|
|
156
|
-
parameterPath: "body",
|
|
157
|
-
mapper: {
|
|
158
|
-
...Mappers.SubscriptionName,
|
|
159
|
-
required: true
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
214
|
responses: {
|
|
163
215
|
200: {
|
|
164
216
|
bodyMapper: Mappers.RenamedSubscriptionId
|
|
165
217
|
},
|
|
166
218
|
default: {
|
|
167
|
-
bodyMapper: Mappers.
|
|
219
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
168
220
|
}
|
|
169
221
|
},
|
|
222
|
+
requestBody: Parameters.body,
|
|
223
|
+
queryParameters: [Parameters.apiVersion1],
|
|
224
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
225
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
226
|
+
mediaType: "json",
|
|
170
227
|
serializer
|
|
171
228
|
};
|
|
172
|
-
|
|
173
|
-
|
|
229
|
+
const enableOperationSpec: coreClient.OperationSpec = {
|
|
230
|
+
path:
|
|
231
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
|
|
174
232
|
httpMethod: "POST",
|
|
175
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
|
|
176
|
-
urlParameters: [
|
|
177
|
-
Parameters.subscriptionId
|
|
178
|
-
],
|
|
179
|
-
queryParameters: [
|
|
180
|
-
Parameters.apiVersion1
|
|
181
|
-
],
|
|
182
|
-
headerParameters: [
|
|
183
|
-
Parameters.acceptLanguage
|
|
184
|
-
],
|
|
185
233
|
responses: {
|
|
186
234
|
200: {
|
|
187
235
|
bodyMapper: Mappers.EnabledSubscriptionId
|
|
188
236
|
},
|
|
189
237
|
default: {
|
|
190
|
-
bodyMapper: Mappers.
|
|
238
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
queryParameters: [Parameters.apiVersion1],
|
|
242
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
243
|
+
headerParameters: [Parameters.accept],
|
|
244
|
+
serializer
|
|
245
|
+
};
|
|
246
|
+
const acceptOwnershipOperationSpec: coreClient.OperationSpec = {
|
|
247
|
+
path:
|
|
248
|
+
"/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership",
|
|
249
|
+
httpMethod: "POST",
|
|
250
|
+
responses: {
|
|
251
|
+
200: {
|
|
252
|
+
headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
|
|
253
|
+
},
|
|
254
|
+
201: {
|
|
255
|
+
headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
|
|
256
|
+
},
|
|
257
|
+
202: {
|
|
258
|
+
headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
|
|
259
|
+
},
|
|
260
|
+
204: {
|
|
261
|
+
headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
|
|
262
|
+
},
|
|
263
|
+
default: {
|
|
264
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
requestBody: Parameters.body1,
|
|
268
|
+
queryParameters: [Parameters.apiVersion1],
|
|
269
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
270
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
271
|
+
mediaType: "json",
|
|
272
|
+
serializer
|
|
273
|
+
};
|
|
274
|
+
const acceptOwnershipStatusOperationSpec: coreClient.OperationSpec = {
|
|
275
|
+
path:
|
|
276
|
+
"/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus",
|
|
277
|
+
httpMethod: "GET",
|
|
278
|
+
responses: {
|
|
279
|
+
200: {
|
|
280
|
+
bodyMapper: Mappers.AcceptOwnershipStatusResponse
|
|
281
|
+
},
|
|
282
|
+
default: {
|
|
283
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
191
284
|
}
|
|
192
285
|
},
|
|
286
|
+
queryParameters: [Parameters.apiVersion1],
|
|
287
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
288
|
+
headerParameters: [Parameters.accept],
|
|
193
289
|
serializer
|
|
194
290
|
};
|