Skip to content
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a1f8ab6
The first version of TSP
melina5656 Aug 29, 2025
9750037
Merge branch 'main' into cost-management-errorresponse-fix
melina5656 Sep 1, 2025
661b5a7
Merge branch 'main' into cost-management-errorresponse-fix
melina5656 Sep 12, 2025
178e8e7
Fix errors and diff
melina5656 Sep 12, 2025
794801a
Delete old swagger files
melina5656 Sep 12, 2025
dd73c01
Update tspconfig.yaml
melina5656 Sep 12, 2025
fb3ae5e
Fix model validation errors and spellcheck errors
melina5656 Sep 12, 2025
90e66bb
Update BillingAccountAlerts.json
melina5656 Sep 12, 2025
d065701
update example files
melina5656 Sep 12, 2025
0b7e473
update example files
melina5656 Sep 12, 2025
706792f
update example files
melina5656 Sep 12, 2025
5274165
Remove operationId Decorator
melina5656 Sep 12, 2025
3d1a24f
Update tspconfig.yaml
melina5656 Sep 12, 2025
9cac238
Add x-ms-long-running-operation to GET operation
melina5656 Oct 17, 2025
85c73f9
Remove unnecessary properties
melina5656 Oct 17, 2025
91bc07f
Update tspconfig.yaml
melina5656 Oct 20, 2025
40e382e
resolve conflicts from folder migration
zedy-wj Oct 31, 2025
0384d32
Merge branch 'main' into convert/cost-management
melina5656 Nov 4, 2025
ad7d1fd
run tsp compile
melina5656 Nov 4, 2025
8393a66
Merge branch 'main' into convert/cost-management
melina5656 Nov 6, 2025
923a482
Add visibility
melina5656 Nov 10, 2025
6633322
Update cspell.yaml
melina5656 Nov 11, 2025
95bc708
Update cspell.yaml
melina5656 Nov 11, 2025
718193e
Update cspell.yaml
melina5656 Nov 11, 2025
291070f
Update cspell.yaml
melina5656 Nov 11, 2025
0ef7989
Update cspell.yaml
melina5656 Nov 11, 2025
29d599b
Update tspconfig.yaml
melina5656 Nov 12, 2025
4251312
format tspconfig.yaml
melina5656 Nov 12, 2025
f02cc39
tsp format
melina5656 Nov 12, 2025
6ccd9c9
Add client.tsp with Java breaking change mitigations
weidongxu-microsoft Nov 12, 2025
308c28d
rename in java
weidongxu-microsoft Nov 12, 2025
5a97dfd
Update client.tsp and tspconfig.yaml with additional breaking change …
weidongxu-microsoft Nov 12, 2025
73f09e1
more java rename
weidongxu-microsoft Nov 12, 2025
58a7ea3
Update specification/cost-management/resource-manager/Microsoft.CostM…
kazrael2119 Nov 14, 2025
0f04521
Merge branch 'main' into cost-management-errorresponse-fix
kazrael2119 Nov 14, 2025
546549c
Update specification/cost-management/resource-manager/Microsoft.CostM…
kazrael2119 Nov 14, 2025
cf50ba4
update
melina5656 Nov 14, 2025
5eaf51d
Merge branch 'cost-management-errorresponse-fix' of https://github.co…
melina5656 Nov 14, 2025
d9d3264
Merge branch 'main' into convert/cost-management
melina5656 Nov 17, 2025
1c0467d
update tagFilter
melina5656 Nov 27, 2025
a75992b
update OperationStatusType
melina5656 Nov 27, 2025
53d58aa
Remove and Replace Deprecated or Disabled Decorators
melina5656 Nov 27, 2025
11dbb8e
Update tspconfig.yaml
melina5656 Nov 27, 2025
b642e04
Update specification/cost-management/resource-manager/Microsoft.CostM…
kazrael2119 Nov 28, 2025
f61e119
Merge branch 'main' into cost-management-errorresponse-fix
kazrael2119 Nov 28, 2025
58c5801
Add client overrides
melina5656 Nov 28, 2025
77dab6c
Update client.tsp
ChenxiJiang333 Nov 28, 2025
1d9a7d2
Update client.tsp
ChenxiJiang333 Nov 28, 2025
c12e031
update operation name for JavaScript
melina5656 Dec 1, 2025
991d3e1
Update CostDetailsOperationResults to be a non-resource model
melina5656 Dec 2, 2025
c5b4124
Replace some list operation templates with ListSinglePage
melina5656 Dec 3, 2025
fe33147
Update readme.md
melina5656 Dec 3, 2025
c8270db
Update client.tsp
kazrael2119 Dec 4, 2025
ac7a987
Merge branch 'main' into cost-management-errorresponse-fix
mikeharder Dec 4, 2025
3d0d17f
Update client.tsp
kazrael2119 Dec 5, 2025
ce6a346
Merge branch 'cost-management-errorresponse-fix' of https://github.co…
kazrael2119 Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions specification/cost-management/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ overrides:
words:
- unitof
- filename: >-
**/specification/cost-management/resource-manager/Microsoft.CostManagement/CostManagement/stable/2025-03-01/costmanagement.pricesheets.json
**/specification/cost-management/resource-manager/Microsoft.CostManagement/CostManagement/stable/2025-03-01/openapi.json
words:
- unitofmeasure
- unitof

- Unitof
- filename: >-
**/specification/cost-management/resource-manager/Microsoft.CostManagement/CostManagement/models.tsp
words:
- unitofmeasure
- unitof
- Unitof
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.CostManagement;
/**
* An individual alert.
*/
model Alert is Azure.ResourceManager.ExtensionResource<AlertProperties> {
...ResourceNameParameter<
Resource = Alert,
KeyName = "alertId",
SegmentName = "alerts",
NamePattern = ""
>;

/**
* eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
eTag?: Azure.Core.eTag;
}

@armResourceOperations
interface AlertsOps
extends Azure.ResourceManager.Legacy.ExtensionOperations<
{
...ApiVersionParameter,

/** The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. */
@path(#{ allowReserved: true })
scope: string,

...Azure.ResourceManager.Legacy.Provider,
},
{},
{}
> {}

@armResourceOperations
interface Alerts {
/**
* Gets the alert for the scope by alert ID.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/costmanagement/")
get is Extension.Read<Extension.ScopeParameter, Alert, Error = ErrorResponse>;

/**
* Dismisses the specified alert
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
@externalDocs("https://docs.microsoft.com/en-us/rest/api/costmanagement/")
dismiss is Extension.CustomPatchSync<
Extension.ScopeParameter,
Alert,
PatchModel = DismissAlertPayload,
Error = ErrorResponse
>;

/**
* Lists the alerts for scope defined.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/costmanagement/")
list is AlertsOps.ListSinglePage<
Alert,
Response = ArmResponse<AlertsResult>,
ErrorType = ErrorResponse
>;
}

@@doc(Alert.name, "Alert ID");
@@doc(Alert.properties, "Alert properties.");
@@doc(Alerts.dismiss::parameters.properties,
"Parameters supplied to the Dismiss Alert operation."
);
@@path(Alert.name, #{ allowReserved: true });
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.CostManagement;
/**
* A budget resource.
*/
model Budget is Azure.ResourceManager.ExtensionResource<BudgetProperties> {
...ResourceNameParameter<
Resource = Budget,
KeyName = "budgetName",
SegmentName = "budgets",
NamePattern = "^[a-zA-Z0-9_-]+$"
>;

/**
* eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
eTag?: Azure.Core.eTag;
}

@armResourceOperations
interface Budgets {
/**
* Gets the budget for the scope by budget name.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/CostManagement/")
get is Extension.Read<
Extension.ScopeParameter,
Budget,
Error = ErrorResponse
>;

/**
* The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/CostManagement/")
createOrUpdate is Extension.CreateOrReplaceSync<
Extension.ScopeParameter,
Budget,
Error = ErrorResponse
>;

/**
* The operation to delete a budget.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/CostManagement/")
delete is Extension.DeleteSync<
Extension.ScopeParameter,
Budget,
Response = ArmDeletedResponse,
Error = ErrorResponse
>;

/**
* Lists all budgets for the defined scope.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@externalDocs("https://docs.microsoft.com/en-us/rest/api/CostManagement/")
list is Extension.ListByTarget<
Extension.ScopeParameter,
Budget,
Parameters = {
/**
* OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' only.
*/
@query("$filter")
$filter?: string;
},
Response = ArmResponse<BudgetsListResult>,
Error = ErrorResponse
>;
}

@@maxLength(Budget.name, 63);
@@minLength(Budget.name, 1);
@@doc(Budget.name, "Budget Name.");
@@doc(Budget.properties, "The properties of the budget.");
@@doc(Budgets.createOrUpdate::parameters.resource,
"Parameters supplied to the Create Budget operation."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.CostManagement;
/**
* The cost allocation rule model definition
*/
@tenantResource
model CostAllocationRuleDefinition
is Azure.ResourceManager.ProxyResource<CostAllocationRuleProperties> {
...ResourceNameParameter<
Resource = CostAllocationRuleDefinition,
KeyName = "ruleName",
SegmentName = "costAllocationRules",
NamePattern = "[A-Za-z0-9\\-_]+"
>;
}

alias CostAllocationRuleDefinitionsOps = Extension.ExternalResource<
"microsoft.Billing",
"billingAccounts",
"billingAccountId",
Description = "BillingAccount ID",
ParentType = "Tenant"
>;

@armResourceOperations
interface CostAllocationRuleDefinitions {
/**
* Get a cost allocation rule by rule name and billing account or enterprise enrollment.
*/
get is Extension.Read<
CostAllocationRuleDefinitionsOps,
CostAllocationRuleDefinition,
Error = ErrorResponse
>;

/**
* Create/Update a rule to allocate cost between different resources within a billing account or enterprise enrollment.
*/
createOrUpdate is Extension.CreateOrReplaceSync<
CostAllocationRuleDefinitionsOps,
CostAllocationRuleDefinition,
Error = ErrorResponse
>;

/**
* Delete cost allocation rule for billing account or enterprise enrollment.
*/
delete is Extension.DeleteSync<
CostAllocationRuleDefinitionsOps,
CostAllocationRuleDefinition,
Error = ErrorResponse
>;

/**
* Get the list of all cost allocation rules for a billing account or enterprise enrollment.
*/
list is Extension.ListByTarget<
CostAllocationRuleDefinitionsOps,
CostAllocationRuleDefinition,
Response = ArmResponse<CostAllocationRuleList>,
Error = ErrorResponse
>;
}

@@doc(CostAllocationRuleDefinition.name,
"Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters."
);
@@doc(CostAllocationRuleDefinition.properties,
"Cost allocation rule properties"
);
@@doc(CostAllocationRuleDefinitions.createOrUpdate::parameters.resource,
"Cost allocation rule to be created or updated"
);
Loading
Loading