Skip to content

Commit 8dd30e6

Browse files
Add validate MACC model
1 parent 697e19f commit 8dd30e6

32 files changed

+1521
-22
lines changed

specification/billingbenefits/BillingBenefits.Management/back-compatible.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ using Microsoft.BillingBenefits;
7979
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ReservationOrderAliasResponse.properties
8080
);
8181

82+
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "For backward compatibility"
83+
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(MaccValidateModel.properties
84+
);
85+
8286
@@clientName(Discounts.create::parameters.resource, "body");
8387
@@clientName(Discounts.update::parameters.properties, "body");
8488

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
10+
"entityType": "Primary",
11+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
12+
"status": "Canceled",
13+
"systemId": "13810867107109237"
14+
}
15+
}
16+
]
17+
}
18+
},
19+
"responses": {
20+
"200": {
21+
"body": {
22+
"benefits": [
23+
{
24+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
25+
"valid": true
26+
}
27+
]
28+
}
29+
}
30+
},
31+
"operationId": "Benefit_Validate",
32+
"title": "MaccValidateCancel"
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
10+
"entityType": "Primary",
11+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
12+
"status": "Canceled",
13+
"systemId": "13810867107109237"
14+
}
15+
}
16+
]
17+
}
18+
},
19+
"responses": {
20+
"200": {
21+
"body": {
22+
"benefits": [
23+
{
24+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
25+
"valid": true
26+
}
27+
]
28+
}
29+
}
30+
},
31+
"operationId": "Benefit_Validate",
32+
"title": "MaccValidateCancelWithMilestones"
33+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"allowContributors": true,
10+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
11+
"commitment": {
12+
"amount": 10000,
13+
"currencyCode": "USD",
14+
"grain": "FullTerm"
15+
},
16+
"endAt": "2024-07-31T23:59:59Z",
17+
"entityType": "Primary",
18+
"productCode": "0001d726-0000-0160-330f-a0b98cdbbdc4",
19+
"resourceId": "/subscriptions/{primaryCloudSubId}/resourceGroups/resource_group_name_01/providers/Microsoft.BillingBenefits/maccs/macc_20230614",
20+
"startAt": "2023-07-01T00:00:00Z",
21+
"systemId": null
22+
}
23+
}
24+
]
25+
}
26+
},
27+
"responses": {
28+
"200": {
29+
"body": {
30+
"benefits": [
31+
{
32+
"resourceId": "/subscriptions/{primaryCloudSubId}/resourceGroups/resource_group_name_01/providers/Microsoft.BillingBenefits/maccs/macc_20230614",
33+
"valid": true
34+
}
35+
]
36+
}
37+
}
38+
},
39+
"operationId": "Benefit_Validate",
40+
"title": "MaccValidateCreate"
41+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
10+
"entityType": "Primary",
11+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
12+
"systemId": "13810867107109237"
13+
}
14+
}
15+
]
16+
}
17+
},
18+
"responses": {
19+
"200": {
20+
"body": {
21+
"benefits": [
22+
{
23+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
24+
"valid": true
25+
}
26+
]
27+
}
28+
}
29+
},
30+
"operationId": "Benefit_Validate",
31+
"title": "MaccValidateCreateBackfilledMacc"
32+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
10+
"entityType": "Contributor",
11+
"primaryResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
12+
"productCode": "0001d726-0000-0160-330f-a0b98cdbbdc4",
13+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
14+
"startAt": "2023-07-01T00:00:00Z",
15+
"systemId": null
16+
}
17+
}
18+
]
19+
}
20+
},
21+
"responses": {
22+
"200": {
23+
"body": {
24+
"benefits": [
25+
{
26+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
27+
"valid": true
28+
}
29+
]
30+
}
31+
}
32+
},
33+
"operationId": "Benefit_Validate",
34+
"title": "MaccValidateCreateContributor"
35+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
10+
"commitment": {
11+
"amount": 20000,
12+
"currencyCode": "USD",
13+
"grain": "FullTerm"
14+
},
15+
"endAt": "2026-07-31T23:59:59Z",
16+
"entityType": "Primary",
17+
"milestones": [
18+
{
19+
"commitment": {
20+
"amount": 7000,
21+
"currencyCode": "USD"
22+
},
23+
"endAt": "2024-10-31T23:59:59Z"
24+
},
25+
{
26+
"commitment": {
27+
"amount": 13000,
28+
"currencyCode": "USD"
29+
},
30+
"endAt": "2025-01-31T23:59:59Z"
31+
}
32+
],
33+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/benefits/myBenefit",
34+
"systemId": "13810867107109237"
35+
}
36+
}
37+
]
38+
}
39+
},
40+
"responses": {
41+
"200": {
42+
"body": {
43+
"benefits": [
44+
{
45+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/benefits/myBenefit",
46+
"valid": true
47+
}
48+
]
49+
}
50+
}
51+
},
52+
"operationId": "Benefit_Validate",
53+
"title": "MaccValidateCreateMilestonesOnExistingMacc"
54+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"allowContributors": true,
10+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
11+
"commitment": {
12+
"amount": 10000,
13+
"currencyCode": "USD",
14+
"grain": "FullTerm"
15+
},
16+
"endAt": "2024-07-31T23:59:59Z",
17+
"entityType": "Primary",
18+
"productCode": "0001d726-0000-0160-330f-a0b98cdbbdc4",
19+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
20+
"startAt": "2023-07-01T00:00:00Z",
21+
"systemId": null
22+
}
23+
},
24+
{
25+
"benefitType": "MACC",
26+
"properties": {
27+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
28+
"entityType": "Contributor",
29+
"primaryResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
30+
"productCode": "0001d726-0000-0160-330f-a0b98cdbbdc4",
31+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
32+
"startAt": "2023-07-01T00:00:00Z",
33+
"systemId": null
34+
}
35+
}
36+
]
37+
}
38+
},
39+
"responses": {
40+
"200": {
41+
"body": {
42+
"benefits": [
43+
{
44+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
45+
"valid": true
46+
},
47+
{
48+
"reason": "Error message",
49+
"reasonCode": "ErrorCode",
50+
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.BillingBenefits/maccs/myBenefit",
51+
"valid": false
52+
}
53+
]
54+
}
55+
}
56+
},
57+
"operationId": "Benefit_Validate",
58+
"title": "MaccValidateCreateMultiEntity"
59+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-05-01-preview",
4+
"body": {
5+
"benefits": [
6+
{
7+
"benefitType": "MACC",
8+
"properties": {
9+
"allowContributors": true,
10+
"billingAccountResourceId": "/providers/Microsoft.Billing/billingAccounts/{acctId:orgId}",
11+
"commitment": {
12+
"amount": 20000,
13+
"currencyCode": "USD",
14+
"grain": "FullTerm"
15+
},
16+
"endAt": "2026-07-31T23:59:59Z",
17+
"entityType": "Primary",
18+
"milestones": [
19+
{
20+
"commitment": {
21+
"amount": 5000,
22+
"currencyCode": "USD"
23+
},
24+
"endAt": "2024-07-31T23:59:59Z"
25+
},
26+
{
27+
"commitment": {
28+
"amount": 15000,
29+
"currencyCode": "USD"
30+
},
31+
"endAt": "2025-07-31T23:59:59Z"
32+
}
33+
],
34+
"productCode": "0001d726-0000-0160-330f-a0b98cdbbdc4",
35+
"resourceId": "/subscriptions/{primaryCloudSubId}/resourceGroups/resource_group_name_01/providers/Microsoft.BillingBenefits/maccs/macc_20230614",
36+
"startAt": "2023-07-01T00:00:00Z",
37+
"systemId": null
38+
}
39+
}
40+
]
41+
}
42+
},
43+
"responses": {
44+
"200": {
45+
"body": {
46+
"benefits": [
47+
{
48+
"resourceId": "/subscriptions/{primaryCloudSubId}/resourceGroups/resource_group_name_01/providers/Microsoft.BillingBenefits/maccs/macc_20230614",
49+
"valid": true
50+
}
51+
]
52+
}
53+
}
54+
},
55+
"operationId": "Benefit_Validate",
56+
"title": "MaccValidateCreateNewMaccWithMilestone"
57+
}

0 commit comments

Comments
 (0)