@azure/arm-subscriptions 3.1.2 → 4.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 +11 -0
- package/{LICENSE.txt → LICENSE} +2 -2
- package/README.md +68 -79
- package/dist/index.js +1772 -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 +514 -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 +29 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +825 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +14 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +110 -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/dist-esm/src/operations/index.d.ts +6 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +13 -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/subscription.d.ts +53 -0
- package/dist-esm/src/operations/subscription.d.ts.map +1 -0
- package/dist-esm/src/operations/subscription.js +201 -0
- package/dist-esm/src/operations/subscription.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/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 +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/subscription.d.ts +45 -0
- package/dist-esm/src/operationsInterfaces/subscription.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/subscription.js +9 -0
- package/dist-esm/src/operationsInterfaces/subscription.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/subscriptionClient.d.ts +20 -0
- package/dist-esm/src/subscriptionClient.d.ts.map +1 -0
- package/dist-esm/src/subscriptionClient.js +49 -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 +446 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +449 -555
- package/src/models/mappers.ts +506 -250
- package/src/models/parameters.ts +82 -27
- package/src/operations/alias.ts +170 -170
- package/src/operations/billingAccount.ts +65 -0
- package/src/operations/index.ts +6 -8
- package/src/operations/operations.ts +103 -40
- package/src/operations/subscription.ts +289 -0
- package/src/operations/subscriptionPolicy.ts +207 -0
- package/src/operationsInterfaces/alias.ts +75 -0
- package/src/operationsInterfaces/billingAccount.ts +25 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/subscription.ts +92 -0
- package/src/operationsInterfaces/subscriptionPolicy.ts +46 -0
- package/src/subscriptionClient.ts +75 -43
- package/tsconfig.json +3 -3
- package/types/arm-subscriptions.d.ts +727 -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 +0 -6
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js +0 -15
- 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/operations/subscriptionOperations.ts +0 -194
- package/src/operations/subscriptions.ts +0 -227
- package/src/operations/tenants.ts +0 -123
- package/src/subscriptionClientContext.ts +0 -60
package/src/models/parameters.ts
CHANGED
|
@@ -1,75 +1,130 @@
|
|
|
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
|
|
9
|
+
import {
|
|
10
|
+
OperationParameter,
|
|
11
|
+
OperationURLParameter,
|
|
12
|
+
OperationQueryParameter
|
|
13
|
+
} from "@azure/core-client";
|
|
14
|
+
import {
|
|
15
|
+
SubscriptionName as SubscriptionNameMapper,
|
|
16
|
+
AcceptOwnershipRequest as AcceptOwnershipRequestMapper,
|
|
17
|
+
PutAliasRequest as PutAliasRequestMapper,
|
|
18
|
+
PutTenantPolicyRequestProperties as PutTenantPolicyRequestPropertiesMapper
|
|
19
|
+
} from "../models/mappers";
|
|
12
20
|
|
|
13
|
-
export const
|
|
14
|
-
parameterPath: "
|
|
21
|
+
export const accept: OperationParameter = {
|
|
22
|
+
parameterPath: "accept",
|
|
15
23
|
mapper: {
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
defaultValue: "application/json",
|
|
25
|
+
isConstant: true,
|
|
26
|
+
serializedName: "Accept",
|
|
18
27
|
type: {
|
|
19
28
|
name: "String"
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
};
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
|
|
33
|
+
export const $host: OperationURLParameter = {
|
|
34
|
+
parameterPath: "$host",
|
|
25
35
|
mapper: {
|
|
36
|
+
serializedName: "$host",
|
|
37
|
+
required: true,
|
|
38
|
+
type: {
|
|
39
|
+
name: "String"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
skipEncoding: true
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const subscriptionId: OperationURLParameter = {
|
|
46
|
+
parameterPath: "subscriptionId",
|
|
47
|
+
mapper: {
|
|
48
|
+
serializedName: "subscriptionId",
|
|
26
49
|
required: true,
|
|
27
|
-
serializedName: "aliasName",
|
|
28
50
|
type: {
|
|
29
51
|
name: "String"
|
|
30
52
|
}
|
|
31
53
|
}
|
|
32
54
|
};
|
|
33
|
-
|
|
55
|
+
|
|
56
|
+
export const apiVersion: OperationQueryParameter = {
|
|
34
57
|
parameterPath: "apiVersion",
|
|
35
58
|
mapper: {
|
|
36
|
-
|
|
59
|
+
defaultValue: "2021-10-01",
|
|
37
60
|
isConstant: true,
|
|
38
61
|
serializedName: "api-version",
|
|
39
|
-
defaultValue: '2016-06-01',
|
|
40
62
|
type: {
|
|
41
63
|
name: "String"
|
|
42
64
|
}
|
|
43
65
|
}
|
|
44
66
|
};
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
|
|
68
|
+
export const contentType: OperationParameter = {
|
|
69
|
+
parameterPath: ["options", "contentType"],
|
|
47
70
|
mapper: {
|
|
48
|
-
|
|
71
|
+
defaultValue: "application/json",
|
|
49
72
|
isConstant: true,
|
|
50
|
-
serializedName: "
|
|
51
|
-
defaultValue: '2020-09-01',
|
|
73
|
+
serializedName: "Content-Type",
|
|
52
74
|
type: {
|
|
53
75
|
name: "String"
|
|
54
76
|
}
|
|
55
77
|
}
|
|
56
78
|
};
|
|
57
|
-
|
|
58
|
-
|
|
79
|
+
|
|
80
|
+
export const body: OperationParameter = {
|
|
81
|
+
parameterPath: "body",
|
|
82
|
+
mapper: SubscriptionNameMapper
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const body1: OperationParameter = {
|
|
86
|
+
parameterPath: "body",
|
|
87
|
+
mapper: AcceptOwnershipRequestMapper
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const nextLink: OperationURLParameter = {
|
|
91
|
+
parameterPath: "nextLink",
|
|
59
92
|
mapper: {
|
|
60
|
-
required: true,
|
|
61
93
|
serializedName: "nextLink",
|
|
94
|
+
required: true,
|
|
62
95
|
type: {
|
|
63
96
|
name: "String"
|
|
64
97
|
}
|
|
65
98
|
},
|
|
66
99
|
skipEncoding: true
|
|
67
100
|
};
|
|
68
|
-
|
|
69
|
-
|
|
101
|
+
|
|
102
|
+
export const body2: OperationParameter = {
|
|
103
|
+
parameterPath: "body",
|
|
104
|
+
mapper: PutAliasRequestMapper
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const aliasName: OperationURLParameter = {
|
|
108
|
+
parameterPath: "aliasName",
|
|
109
|
+
mapper: {
|
|
110
|
+
serializedName: "aliasName",
|
|
111
|
+
required: true,
|
|
112
|
+
type: {
|
|
113
|
+
name: "String"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const body3: OperationParameter = {
|
|
119
|
+
parameterPath: "body",
|
|
120
|
+
mapper: PutTenantPolicyRequestPropertiesMapper
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const billingAccountId: OperationURLParameter = {
|
|
124
|
+
parameterPath: "billingAccountId",
|
|
70
125
|
mapper: {
|
|
126
|
+
serializedName: "billingAccountId",
|
|
71
127
|
required: true,
|
|
72
|
-
serializedName: "subscriptionId",
|
|
73
128
|
type: {
|
|
74
129
|
name: "String"
|
|
75
130
|
}
|
package/src/operations/alias.ts
CHANGED
|
@@ -1,239 +1,239 @@
|
|
|
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
|
|
14
|
-
import * as Mappers from "../models/aliasMappers";
|
|
9
|
+
import { Alias } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
15
12
|
import * as Parameters from "../models/parameters";
|
|
16
|
-
import {
|
|
13
|
+
import { SubscriptionClient } from "../subscriptionClient";
|
|
14
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
15
|
+
import { LroImpl } from "../lroImpl";
|
|
16
|
+
import {
|
|
17
|
+
PutAliasRequest,
|
|
18
|
+
AliasCreateOptionalParams,
|
|
19
|
+
AliasCreateResponse,
|
|
20
|
+
AliasGetOptionalParams,
|
|
21
|
+
AliasGetResponse,
|
|
22
|
+
AliasDeleteOptionalParams,
|
|
23
|
+
AliasListOptionalParams,
|
|
24
|
+
AliasListResponse
|
|
25
|
+
} from "../models";
|
|
17
26
|
|
|
18
|
-
/** Class
|
|
19
|
-
export class Alias {
|
|
20
|
-
private readonly client:
|
|
27
|
+
/** Class containing Alias operations. */
|
|
28
|
+
export class AliasImpl implements Alias {
|
|
29
|
+
private readonly client: SubscriptionClient;
|
|
21
30
|
|
|
22
31
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @param
|
|
32
|
+
* Initialize a new instance of the class Alias class.
|
|
33
|
+
* @param client Reference to the service client
|
|
25
34
|
*/
|
|
26
|
-
constructor(client:
|
|
35
|
+
constructor(client: SubscriptionClient) {
|
|
27
36
|
this.client = client;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
/**
|
|
31
40
|
* Create Alias Subscription.
|
|
32
|
-
* @param aliasName
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
41
|
+
* @param aliasName AliasName is the name for the subscription creation request. Note that this is not
|
|
42
|
+
* the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
|
|
43
|
+
* subscription creation.
|
|
44
|
+
* @param body The parameters required to create a new subscription.
|
|
45
|
+
* @param options The options parameters.
|
|
36
46
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
async beginCreate(
|
|
48
|
+
aliasName: string,
|
|
49
|
+
body: PutAliasRequest,
|
|
50
|
+
options?: AliasCreateOptionalParams
|
|
51
|
+
): Promise<
|
|
52
|
+
PollerLike<PollOperationState<AliasCreateResponse>, AliasCreateResponse>
|
|
53
|
+
> {
|
|
54
|
+
const directSendOperation = async (
|
|
55
|
+
args: coreClient.OperationArguments,
|
|
56
|
+
spec: coreClient.OperationSpec
|
|
57
|
+
): Promise<AliasCreateResponse> => {
|
|
58
|
+
return this.client.sendOperationRequest(args, spec);
|
|
59
|
+
};
|
|
60
|
+
const sendOperation = async (
|
|
61
|
+
args: coreClient.OperationArguments,
|
|
62
|
+
spec: coreClient.OperationSpec
|
|
63
|
+
) => {
|
|
64
|
+
let currentRawResponse:
|
|
65
|
+
| coreClient.FullOperationResponse
|
|
66
|
+
| undefined = undefined;
|
|
67
|
+
const providedCallback = args.options?.onResponse;
|
|
68
|
+
const callback: coreClient.RawResponseCallback = (
|
|
69
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
70
|
+
flatResponse: unknown
|
|
71
|
+
) => {
|
|
72
|
+
currentRawResponse = rawResponse;
|
|
73
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
74
|
+
};
|
|
75
|
+
const updatedArgs = {
|
|
76
|
+
...args,
|
|
77
|
+
options: {
|
|
78
|
+
...args.options,
|
|
79
|
+
onResponse: callback
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
83
|
+
return {
|
|
84
|
+
flatResponse,
|
|
85
|
+
rawResponse: {
|
|
86
|
+
statusCode: currentRawResponse!.status,
|
|
87
|
+
body: currentRawResponse!.parsedBody,
|
|
88
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const lro = new LroImpl(
|
|
94
|
+
sendOperation,
|
|
95
|
+
{ aliasName, body, options },
|
|
96
|
+
createOperationSpec
|
|
97
|
+
);
|
|
98
|
+
return new LroEngine(lro, {
|
|
99
|
+
resumeFrom: options?.resumeFrom,
|
|
100
|
+
intervalInMs: options?.updateIntervalInMs
|
|
101
|
+
});
|
|
40
102
|
}
|
|
41
103
|
|
|
42
104
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param aliasName
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @param aliasName Alias Name
|
|
51
|
-
* @param callback The callback
|
|
52
|
-
*/
|
|
53
|
-
get(aliasName: string, callback: msRest.ServiceCallback<Models.PutAliasResponse>): void;
|
|
54
|
-
/**
|
|
55
|
-
* @param aliasName Alias Name
|
|
56
|
-
* @param options The optional parameters
|
|
57
|
-
* @param callback The callback
|
|
105
|
+
* Create Alias Subscription.
|
|
106
|
+
* @param aliasName AliasName is the name for the subscription creation request. Note that this is not
|
|
107
|
+
* the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
|
|
108
|
+
* subscription creation.
|
|
109
|
+
* @param body The parameters required to create a new subscription.
|
|
110
|
+
* @param options The options parameters.
|
|
58
111
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
getOperationSpec,
|
|
67
|
-
callback) as Promise<Models.AliasGetResponse>;
|
|
112
|
+
async beginCreateAndWait(
|
|
113
|
+
aliasName: string,
|
|
114
|
+
body: PutAliasRequest,
|
|
115
|
+
options?: AliasCreateOptionalParams
|
|
116
|
+
): Promise<AliasCreateResponse> {
|
|
117
|
+
const poller = await this.beginCreate(aliasName, body, options);
|
|
118
|
+
return poller.pollUntilDone();
|
|
68
119
|
}
|
|
69
120
|
|
|
70
121
|
/**
|
|
71
|
-
*
|
|
72
|
-
* @param aliasName
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
deleteMethod(aliasName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* @param aliasName Alias Name
|
|
79
|
-
* @param callback The callback
|
|
80
|
-
*/
|
|
81
|
-
deleteMethod(aliasName: string, callback: msRest.ServiceCallback<void>): void;
|
|
82
|
-
/**
|
|
83
|
-
* @param aliasName Alias Name
|
|
84
|
-
* @param options The optional parameters
|
|
85
|
-
* @param callback The callback
|
|
122
|
+
* Get Alias Subscription.
|
|
123
|
+
* @param aliasName AliasName is the name for the subscription creation request. Note that this is not
|
|
124
|
+
* the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
|
|
125
|
+
* subscription creation.
|
|
126
|
+
* @param options The options parameters.
|
|
86
127
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
128
|
+
get(
|
|
129
|
+
aliasName: string,
|
|
130
|
+
options?: AliasGetOptionalParams
|
|
131
|
+
): Promise<AliasGetResponse> {
|
|
89
132
|
return this.client.sendOperationRequest(
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
deleteMethodOperationSpec,
|
|
95
|
-
callback);
|
|
133
|
+
{ aliasName, options },
|
|
134
|
+
getOperationSpec
|
|
135
|
+
);
|
|
96
136
|
}
|
|
97
137
|
|
|
98
138
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @param
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @param callback The callback
|
|
106
|
-
*/
|
|
107
|
-
list(callback: msRest.ServiceCallback<Models.PutAliasListResult>): void;
|
|
108
|
-
/**
|
|
109
|
-
* @param options The optional parameters
|
|
110
|
-
* @param callback The callback
|
|
139
|
+
* Delete Alias.
|
|
140
|
+
* @param aliasName AliasName is the name for the subscription creation request. Note that this is not
|
|
141
|
+
* the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
|
|
142
|
+
* subscription creation.
|
|
143
|
+
* @param options The options parameters.
|
|
111
144
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
145
|
+
delete(
|
|
146
|
+
aliasName: string,
|
|
147
|
+
options?: AliasDeleteOptionalParams
|
|
148
|
+
): Promise<void> {
|
|
114
149
|
return this.client.sendOperationRequest(
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
listOperationSpec,
|
|
119
|
-
callback) as Promise<Models.AliasListResponse>;
|
|
150
|
+
{ aliasName, options },
|
|
151
|
+
deleteOperationSpec
|
|
152
|
+
);
|
|
120
153
|
}
|
|
121
154
|
|
|
122
155
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @param
|
|
125
|
-
* @param body
|
|
126
|
-
* @param [options] The optional parameters
|
|
127
|
-
* @returns Promise<msRestAzure.LROPoller>
|
|
156
|
+
* List Alias Subscription.
|
|
157
|
+
* @param options The options parameters.
|
|
128
158
|
*/
|
|
129
|
-
|
|
130
|
-
return this.client.
|
|
131
|
-
{
|
|
132
|
-
aliasName,
|
|
133
|
-
body,
|
|
134
|
-
options
|
|
135
|
-
},
|
|
136
|
-
beginCreateOperationSpec,
|
|
137
|
-
options);
|
|
159
|
+
list(options?: AliasListOptionalParams): Promise<AliasListResponse> {
|
|
160
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
138
161
|
}
|
|
139
162
|
}
|
|
140
|
-
|
|
141
163
|
// Operation Specifications
|
|
142
|
-
const serializer =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
path: "providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
146
|
-
|
|
147
|
-
Parameters.aliasName
|
|
148
|
-
],
|
|
149
|
-
queryParameters: [
|
|
150
|
-
Parameters.apiVersion1
|
|
151
|
-
],
|
|
152
|
-
headerParameters: [
|
|
153
|
-
Parameters.acceptLanguage
|
|
154
|
-
],
|
|
164
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
165
|
+
|
|
166
|
+
const createOperationSpec: coreClient.OperationSpec = {
|
|
167
|
+
path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
168
|
+
httpMethod: "PUT",
|
|
155
169
|
responses: {
|
|
156
170
|
200: {
|
|
157
|
-
bodyMapper: Mappers.
|
|
171
|
+
bodyMapper: Mappers.SubscriptionAliasResponse
|
|
172
|
+
},
|
|
173
|
+
201: {
|
|
174
|
+
bodyMapper: Mappers.SubscriptionAliasResponse
|
|
175
|
+
},
|
|
176
|
+
202: {
|
|
177
|
+
bodyMapper: Mappers.SubscriptionAliasResponse
|
|
178
|
+
},
|
|
179
|
+
204: {
|
|
180
|
+
bodyMapper: Mappers.SubscriptionAliasResponse
|
|
158
181
|
},
|
|
159
182
|
default: {
|
|
160
183
|
bodyMapper: Mappers.ErrorResponseBody
|
|
161
184
|
}
|
|
162
185
|
},
|
|
186
|
+
requestBody: Parameters.body2,
|
|
187
|
+
queryParameters: [Parameters.apiVersion],
|
|
188
|
+
urlParameters: [Parameters.$host, Parameters.aliasName],
|
|
189
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
190
|
+
mediaType: "json",
|
|
163
191
|
serializer
|
|
164
192
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
httpMethod: "
|
|
168
|
-
path: "providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
169
|
-
urlParameters: [
|
|
170
|
-
Parameters.aliasName
|
|
171
|
-
],
|
|
172
|
-
queryParameters: [
|
|
173
|
-
Parameters.apiVersion1
|
|
174
|
-
],
|
|
175
|
-
headerParameters: [
|
|
176
|
-
Parameters.acceptLanguage
|
|
177
|
-
],
|
|
193
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
194
|
+
path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
195
|
+
httpMethod: "GET",
|
|
178
196
|
responses: {
|
|
179
|
-
200: {
|
|
180
|
-
|
|
197
|
+
200: {
|
|
198
|
+
bodyMapper: Mappers.SubscriptionAliasResponse
|
|
199
|
+
},
|
|
181
200
|
default: {
|
|
182
201
|
bodyMapper: Mappers.ErrorResponseBody
|
|
183
202
|
}
|
|
184
203
|
},
|
|
204
|
+
queryParameters: [Parameters.apiVersion],
|
|
205
|
+
urlParameters: [Parameters.$host, Parameters.aliasName],
|
|
206
|
+
headerParameters: [Parameters.accept],
|
|
185
207
|
serializer
|
|
186
208
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
httpMethod: "
|
|
190
|
-
path: "providers/Microsoft.Subscription/aliases",
|
|
191
|
-
queryParameters: [
|
|
192
|
-
Parameters.apiVersion1
|
|
193
|
-
],
|
|
194
|
-
headerParameters: [
|
|
195
|
-
Parameters.acceptLanguage
|
|
196
|
-
],
|
|
209
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
210
|
+
path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
211
|
+
httpMethod: "DELETE",
|
|
197
212
|
responses: {
|
|
198
|
-
200: {
|
|
199
|
-
|
|
200
|
-
},
|
|
213
|
+
200: {},
|
|
214
|
+
204: {},
|
|
201
215
|
default: {
|
|
202
216
|
bodyMapper: Mappers.ErrorResponseBody
|
|
203
217
|
}
|
|
204
218
|
},
|
|
219
|
+
queryParameters: [Parameters.apiVersion],
|
|
220
|
+
urlParameters: [Parameters.$host, Parameters.aliasName],
|
|
221
|
+
headerParameters: [Parameters.accept],
|
|
205
222
|
serializer
|
|
206
223
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
httpMethod: "
|
|
210
|
-
path: "providers/Microsoft.Subscription/aliases/{aliasName}",
|
|
211
|
-
urlParameters: [
|
|
212
|
-
Parameters.aliasName
|
|
213
|
-
],
|
|
214
|
-
queryParameters: [
|
|
215
|
-
Parameters.apiVersion1
|
|
216
|
-
],
|
|
217
|
-
headerParameters: [
|
|
218
|
-
Parameters.acceptLanguage
|
|
219
|
-
],
|
|
220
|
-
requestBody: {
|
|
221
|
-
parameterPath: "body",
|
|
222
|
-
mapper: {
|
|
223
|
-
...Mappers.PutAliasRequest,
|
|
224
|
-
required: true
|
|
225
|
-
}
|
|
226
|
-
},
|
|
224
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
225
|
+
path: "/providers/Microsoft.Subscription/aliases",
|
|
226
|
+
httpMethod: "GET",
|
|
227
227
|
responses: {
|
|
228
228
|
200: {
|
|
229
|
-
bodyMapper: Mappers.
|
|
230
|
-
},
|
|
231
|
-
201: {
|
|
232
|
-
bodyMapper: Mappers.PutAliasResponse
|
|
229
|
+
bodyMapper: Mappers.SubscriptionAliasListResult
|
|
233
230
|
},
|
|
234
231
|
default: {
|
|
235
232
|
bodyMapper: Mappers.ErrorResponseBody
|
|
236
233
|
}
|
|
237
234
|
},
|
|
235
|
+
queryParameters: [Parameters.apiVersion],
|
|
236
|
+
urlParameters: [Parameters.$host],
|
|
237
|
+
headerParameters: [Parameters.accept],
|
|
238
238
|
serializer
|
|
239
239
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { BillingAccount } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { SubscriptionClient } from "../subscriptionClient";
|
|
14
|
+
import {
|
|
15
|
+
BillingAccountGetPolicyOptionalParams,
|
|
16
|
+
BillingAccountGetPolicyResponse
|
|
17
|
+
} from "../models";
|
|
18
|
+
|
|
19
|
+
/** Class containing BillingAccount operations. */
|
|
20
|
+
export class BillingAccountImpl implements BillingAccount {
|
|
21
|
+
private readonly client: SubscriptionClient;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Initialize a new instance of the class BillingAccount class.
|
|
25
|
+
* @param client Reference to the service client
|
|
26
|
+
*/
|
|
27
|
+
constructor(client: SubscriptionClient) {
|
|
28
|
+
this.client = client;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get Billing Account Policy.
|
|
33
|
+
* @param billingAccountId Billing Account Id.
|
|
34
|
+
* @param options The options parameters.
|
|
35
|
+
*/
|
|
36
|
+
getPolicy(
|
|
37
|
+
billingAccountId: string,
|
|
38
|
+
options?: BillingAccountGetPolicyOptionalParams
|
|
39
|
+
): Promise<BillingAccountGetPolicyResponse> {
|
|
40
|
+
return this.client.sendOperationRequest(
|
|
41
|
+
{ billingAccountId, options },
|
|
42
|
+
getPolicyOperationSpec
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Operation Specifications
|
|
47
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
48
|
+
|
|
49
|
+
const getPolicyOperationSpec: coreClient.OperationSpec = {
|
|
50
|
+
path:
|
|
51
|
+
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default",
|
|
52
|
+
httpMethod: "GET",
|
|
53
|
+
responses: {
|
|
54
|
+
200: {
|
|
55
|
+
bodyMapper: Mappers.BillingAccountPoliciesResponse
|
|
56
|
+
},
|
|
57
|
+
default: {
|
|
58
|
+
bodyMapper: Mappers.ErrorResponseBody
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
queryParameters: [Parameters.apiVersion],
|
|
62
|
+
urlParameters: [Parameters.$host, Parameters.billingAccountId],
|
|
63
|
+
headerParameters: [Parameters.accept],
|
|
64
|
+
serializer
|
|
65
|
+
};
|
package/src/operations/index.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
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
|
-
export * from "./
|
|
12
|
-
export * from "./tenants";
|
|
13
|
-
export * from "./subscriptionOperations";
|
|
9
|
+
export * from "./subscription";
|
|
14
10
|
export * from "./operations";
|
|
15
11
|
export * from "./alias";
|
|
12
|
+
export * from "./subscriptionPolicy";
|
|
13
|
+
export * from "./billingAccount";
|