diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json
index 7c83f312205c..bea202c838bc 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "493aa7224fd65fe1e5b4cff59bcae5c6cdf4525e",
+ "commit": "ed75b013ee35526ab272e5598fa29669cec53331",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
- "autorest": "3.9.2",
+ "autorest": "3.9.7",
"use": [
- "@autorest/python@6.6.0",
- "@autorest/modelerfour@4.24.3"
+ "@autorest/python@6.7.1",
+ "@autorest/modelerfour@4.26.2"
],
- "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2022-10 --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
+ "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"readme": "specification/cost-management/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py
index 8087ca9f9c1f..c9b5460cf86a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py
@@ -27,14 +27,14 @@ class CostManagementClientConfiguration(Configuration): # pylint: disable=too-m
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
- :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
super(CostManagementClientConfiguration, self).__init__(**kwargs)
- api_version: str = kwargs.pop("api_version", "2022-10-01")
+ api_version: str = kwargs.pop("api_version", "2023-08-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py
index 0e26e2fa3291..a8b987434c55 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py
@@ -19,9 +19,12 @@
AlertsOperations,
BenefitRecommendationsOperations,
BenefitUtilizationSummariesOperations,
+ BudgetsOperations,
+ CostAllocationRulesOperations,
DimensionsOperations,
ExportsOperations,
ForecastOperations,
+ GenerateBenefitUtilizationSummariesReportOperations,
GenerateCostDetailsReportOperations,
GenerateDetailedCostReportOperationResultsOperations,
GenerateDetailedCostReportOperationStatusOperations,
@@ -31,6 +34,7 @@
PriceSheetOperations,
QueryOperations,
ScheduledActionsOperations,
+ SettingsOperations,
ViewsOperations,
)
@@ -45,20 +49,18 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor
:ivar operations: Operations operations
:vartype operations: azure.mgmt.costmanagement.operations.Operations
- :ivar views: ViewsOperations operations
- :vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
- :ivar alerts: AlertsOperations operations
- :vartype alerts: azure.mgmt.costmanagement.operations.AlertsOperations
- :ivar forecast: ForecastOperations operations
- :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations
- :ivar dimensions: DimensionsOperations operations
- :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
- :ivar query: QueryOperations operations
- :vartype query: azure.mgmt.costmanagement.operations.QueryOperations
- :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
- operations
- :vartype generate_reservation_details_report:
- azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations
+ :ivar benefit_recommendations: BenefitRecommendationsOperations operations
+ :vartype benefit_recommendations:
+ azure.mgmt.costmanagement.operations.BenefitRecommendationsOperations
+ :ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
+ :vartype benefit_utilization_summaries:
+ azure.mgmt.costmanagement.operations.BenefitUtilizationSummariesOperations
+ :ivar generate_benefit_utilization_summaries_report:
+ GenerateBenefitUtilizationSummariesReportOperations operations
+ :vartype generate_benefit_utilization_summaries_report:
+ azure.mgmt.costmanagement.operations.GenerateBenefitUtilizationSummariesReportOperations
+ :ivar budgets: BudgetsOperations operations
+ :vartype budgets: azure.mgmt.costmanagement.operations.BudgetsOperations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations
:ivar generate_cost_details_report: GenerateCostDetailsReportOperations operations
@@ -75,21 +77,34 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor
GenerateDetailedCostReportOperationStatusOperations operations
:vartype generate_detailed_cost_report_operation_status:
azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationStatusOperations
+ :ivar views: ViewsOperations operations
+ :vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
+ :ivar alerts: AlertsOperations operations
+ :vartype alerts: azure.mgmt.costmanagement.operations.AlertsOperations
+ :ivar forecast: ForecastOperations operations
+ :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations
+ :ivar dimensions: DimensionsOperations operations
+ :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
+ :ivar query: QueryOperations operations
+ :vartype query: azure.mgmt.costmanagement.operations.QueryOperations
+ :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
+ operations
+ :vartype generate_reservation_details_report:
+ azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations
:ivar price_sheet: PriceSheetOperations operations
:vartype price_sheet: azure.mgmt.costmanagement.operations.PriceSheetOperations
:ivar scheduled_actions: ScheduledActionsOperations operations
:vartype scheduled_actions: azure.mgmt.costmanagement.operations.ScheduledActionsOperations
- :ivar benefit_recommendations: BenefitRecommendationsOperations operations
- :vartype benefit_recommendations:
- azure.mgmt.costmanagement.operations.BenefitRecommendationsOperations
- :ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
- :vartype benefit_utilization_summaries:
- azure.mgmt.costmanagement.operations.BenefitUtilizationSummariesOperations
+ :ivar cost_allocation_rules: CostAllocationRulesOperations operations
+ :vartype cost_allocation_rules:
+ azure.mgmt.costmanagement.operations.CostAllocationRulesOperations
+ :ivar settings: SettingsOperations operations
+ :vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -107,14 +122,16 @@ def __init__(
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
- self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
- self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
+ self.benefit_recommendations = BenefitRecommendationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.generate_benefit_utilization_summaries_report = GenerateBenefitUtilizationSummariesReportOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.budgets = BudgetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.exports = ExportsOperations(self._client, self._config, self._serialize, self._deserialize)
self.generate_cost_details_report = GenerateCostDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize
@@ -128,16 +145,22 @@ def __init__(
self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
- self.scheduled_actions = ScheduledActionsOperations(
+ self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.benefit_recommendations = BenefitRecommendationsOperations(
+ self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.scheduled_actions = ScheduledActionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
+ self.cost_allocation_rules = CostAllocationRulesOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.settings = SettingsOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py
index 842ae727fbbc..4bae2292227b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
_serialized.update(_new_attr) # type: ignore
_new_attr = _new_attr[k] # type: ignore
_serialized = _serialized[k]
- except ValueError:
- continue
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
:param data: The data to be serialized.
:param str data_type: The type to be serialized from.
+ :keyword bool skip_quote: Whether to skip quote the serialized result.
+ Defaults to False.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
- if not kwargs.get("skip_quote", False):
- data = [quote(str(d), safe="") for d in data]
- return str(self.serialize_iter(data, internal_data_type, **kwargs))
+ do_quote = not kwargs.get("skip_quote", False)
+ return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
# Not a list, regular serialization
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
+ :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
+ Defaults to False.
:rtype: list, str
"""
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
for d in data:
try:
serialized.append(self.serialize_data(d, iter_type, **kwargs))
- except ValueError:
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
serialized.append(None)
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
+
if div:
serialized = ["" if s is None else str(s) for s in serialized]
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
for key, value in attr.items():
try:
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
- except ValueError:
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
serialized[self.serialize_unicode(key)] = None
if "xml" in serialization_ctxt:
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py
index bd0df84f5319..0dafe0e287ff 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py
@@ -5,8 +5,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import List, cast
-
from azure.core.pipeline.transport import HttpRequest
@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
if files:
request.set_formdata_body(files)
return request
-
-
-def _format_url_section(template, **kwargs):
- components = template.split("/")
- while components:
- try:
- return template.format(**kwargs)
- except KeyError as key:
- # Need the cast, as for some reasons "split" is typed as list[str | Any]
- formatted_components = cast(List[str], template.split("/"))
- components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
- template = "/".join(components)
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py
index f4674910a502..e5754a47ce68 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "4.0.1"
+VERSION = "1.0.0b1"
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py
index 55e6f4190aa5..33e245e0e54f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py
@@ -27,14 +27,14 @@ class CostManagementClientConfiguration(Configuration): # pylint: disable=too-m
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
- :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
super(CostManagementClientConfiguration, self).__init__(**kwargs)
- api_version: str = kwargs.pop("api_version", "2022-10-01")
+ api_version: str = kwargs.pop("api_version", "2023-08-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py
index daa9e01ede33..73eef7c706b2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py
@@ -19,9 +19,12 @@
AlertsOperations,
BenefitRecommendationsOperations,
BenefitUtilizationSummariesOperations,
+ BudgetsOperations,
+ CostAllocationRulesOperations,
DimensionsOperations,
ExportsOperations,
ForecastOperations,
+ GenerateBenefitUtilizationSummariesReportOperations,
GenerateCostDetailsReportOperations,
GenerateDetailedCostReportOperationResultsOperations,
GenerateDetailedCostReportOperationStatusOperations,
@@ -31,6 +34,7 @@
PriceSheetOperations,
QueryOperations,
ScheduledActionsOperations,
+ SettingsOperations,
ViewsOperations,
)
@@ -45,20 +49,18 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor
:ivar operations: Operations operations
:vartype operations: azure.mgmt.costmanagement.aio.operations.Operations
- :ivar views: ViewsOperations operations
- :vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations
- :ivar alerts: AlertsOperations operations
- :vartype alerts: azure.mgmt.costmanagement.aio.operations.AlertsOperations
- :ivar forecast: ForecastOperations operations
- :vartype forecast: azure.mgmt.costmanagement.aio.operations.ForecastOperations
- :ivar dimensions: DimensionsOperations operations
- :vartype dimensions: azure.mgmt.costmanagement.aio.operations.DimensionsOperations
- :ivar query: QueryOperations operations
- :vartype query: azure.mgmt.costmanagement.aio.operations.QueryOperations
- :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
- operations
- :vartype generate_reservation_details_report:
- azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations
+ :ivar benefit_recommendations: BenefitRecommendationsOperations operations
+ :vartype benefit_recommendations:
+ azure.mgmt.costmanagement.aio.operations.BenefitRecommendationsOperations
+ :ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
+ :vartype benefit_utilization_summaries:
+ azure.mgmt.costmanagement.aio.operations.BenefitUtilizationSummariesOperations
+ :ivar generate_benefit_utilization_summaries_report:
+ GenerateBenefitUtilizationSummariesReportOperations operations
+ :vartype generate_benefit_utilization_summaries_report:
+ azure.mgmt.costmanagement.aio.operations.GenerateBenefitUtilizationSummariesReportOperations
+ :ivar budgets: BudgetsOperations operations
+ :vartype budgets: azure.mgmt.costmanagement.aio.operations.BudgetsOperations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations
:ivar generate_cost_details_report: GenerateCostDetailsReportOperations operations
@@ -75,21 +77,34 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor
GenerateDetailedCostReportOperationStatusOperations operations
:vartype generate_detailed_cost_report_operation_status:
azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperationStatusOperations
+ :ivar views: ViewsOperations operations
+ :vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations
+ :ivar alerts: AlertsOperations operations
+ :vartype alerts: azure.mgmt.costmanagement.aio.operations.AlertsOperations
+ :ivar forecast: ForecastOperations operations
+ :vartype forecast: azure.mgmt.costmanagement.aio.operations.ForecastOperations
+ :ivar dimensions: DimensionsOperations operations
+ :vartype dimensions: azure.mgmt.costmanagement.aio.operations.DimensionsOperations
+ :ivar query: QueryOperations operations
+ :vartype query: azure.mgmt.costmanagement.aio.operations.QueryOperations
+ :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
+ operations
+ :vartype generate_reservation_details_report:
+ azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations
:ivar price_sheet: PriceSheetOperations operations
:vartype price_sheet: azure.mgmt.costmanagement.aio.operations.PriceSheetOperations
:ivar scheduled_actions: ScheduledActionsOperations operations
:vartype scheduled_actions: azure.mgmt.costmanagement.aio.operations.ScheduledActionsOperations
- :ivar benefit_recommendations: BenefitRecommendationsOperations operations
- :vartype benefit_recommendations:
- azure.mgmt.costmanagement.aio.operations.BenefitRecommendationsOperations
- :ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
- :vartype benefit_utilization_summaries:
- azure.mgmt.costmanagement.aio.operations.BenefitUtilizationSummariesOperations
+ :ivar cost_allocation_rules: CostAllocationRulesOperations operations
+ :vartype cost_allocation_rules:
+ azure.mgmt.costmanagement.aio.operations.CostAllocationRulesOperations
+ :ivar settings: SettingsOperations operations
+ :vartype settings: azure.mgmt.costmanagement.aio.operations.SettingsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -107,14 +122,16 @@ def __init__(
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
- self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
- self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
+ self.benefit_recommendations = BenefitRecommendationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.generate_benefit_utilization_summaries_report = GenerateBenefitUtilizationSummariesReportOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.budgets = BudgetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.exports = ExportsOperations(self._client, self._config, self._serialize, self._deserialize)
self.generate_cost_details_report = GenerateCostDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize
@@ -128,16 +145,22 @@ def __init__(
self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
- self.scheduled_actions = ScheduledActionsOperations(
+ self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.benefit_recommendations = BenefitRecommendationsOperations(
+ self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.scheduled_actions = ScheduledActionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
+ self.cost_allocation_rules = CostAllocationRulesOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.settings = SettingsOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py
index ba3f6355c103..1c86bbc36a0d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py
@@ -7,12 +7,12 @@
# --------------------------------------------------------------------------
from ._operations import Operations
-from ._views_operations import ViewsOperations
-from ._alerts_operations import AlertsOperations
-from ._forecast_operations import ForecastOperations
-from ._dimensions_operations import DimensionsOperations
-from ._query_operations import QueryOperations
-from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations
+from ._benefit_recommendations_operations import BenefitRecommendationsOperations
+from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations
+from ._generate_benefit_utilization_summaries_report_operations import (
+ GenerateBenefitUtilizationSummariesReportOperations,
+)
+from ._budgets_operations import BudgetsOperations
from ._exports_operations import ExportsOperations
from ._generate_cost_details_report_operations import GenerateCostDetailsReportOperations
from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations
@@ -22,10 +22,16 @@
from ._generate_detailed_cost_report_operation_status_operations import (
GenerateDetailedCostReportOperationStatusOperations,
)
+from ._views_operations import ViewsOperations
+from ._alerts_operations import AlertsOperations
+from ._forecast_operations import ForecastOperations
+from ._dimensions_operations import DimensionsOperations
+from ._query_operations import QueryOperations
+from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations
from ._price_sheet_operations import PriceSheetOperations
from ._scheduled_actions_operations import ScheduledActionsOperations
-from ._benefit_recommendations_operations import BenefitRecommendationsOperations
-from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations
+from ._cost_allocation_rules_operations import CostAllocationRulesOperations
+from ._settings_operations import SettingsOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -33,21 +39,25 @@
__all__ = [
"Operations",
+ "BenefitRecommendationsOperations",
+ "BenefitUtilizationSummariesOperations",
+ "GenerateBenefitUtilizationSummariesReportOperations",
+ "BudgetsOperations",
+ "ExportsOperations",
+ "GenerateCostDetailsReportOperations",
+ "GenerateDetailedCostReportOperations",
+ "GenerateDetailedCostReportOperationResultsOperations",
+ "GenerateDetailedCostReportOperationStatusOperations",
"ViewsOperations",
"AlertsOperations",
"ForecastOperations",
"DimensionsOperations",
"QueryOperations",
"GenerateReservationDetailsReportOperations",
- "ExportsOperations",
- "GenerateCostDetailsReportOperations",
- "GenerateDetailedCostReportOperations",
- "GenerateDetailedCostReportOperationResultsOperations",
- "GenerateDetailedCostReportOperationStatusOperations",
"PriceSheetOperations",
"ScheduledActionsOperations",
- "BenefitRecommendationsOperations",
- "BenefitUtilizationSummariesOperations",
+ "CostAllocationRulesOperations",
+ "SettingsOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_budgets_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_budgets_operations.py
new file mode 100644
index 000000000000..9f145614e47c
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_budgets_operations.py
@@ -0,0 +1,718 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ..._vendor import _convert_request
+from ...operations._budgets_operations import (
+ build_create_or_update_request,
+ build_delete_request,
+ build_get_request,
+ build_list_request,
+)
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class BudgetsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.aio.CostManagementClient`'s
+ :attr:`budgets` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(self, scope: str, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Budget"]:
+ """Lists all budgets for the defined scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param filter: OData filter option. May be used to filter budgets by properties/category. The
+ filter supports 'eq' only. Default value is None.
+ :type filter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either Budget or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.Budget]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.BudgetsListResult] = kwargs.pop("cls", None)
+
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ request = build_list_request(
+ scope=scope,
+ filter=filter,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+ request.method = "GET"
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("BudgetsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets"}
+
+ @distributed_trace_async
+ async def get(self, scope: str, budget_name: str, **kwargs: Any) -> _models.Budget:
+ """Gets the budget for the scope by budget name.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.Budget] = kwargs.pop("cls", None)
+
+ request = build_get_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ template_url=self.get.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
+
+ @overload
+ async def create_or_update(
+ self,
+ scope: str,
+ budget_name: str,
+ parameters: _models.Budget,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Required.
+ :type parameters: ~azure.mgmt.costmanagement.models.Budget
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self, scope: str, budget_name: str, parameters: IO, *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Required.
+ :type parameters: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def create_or_update(
+ self, scope: str, budget_name: str, parameters: Union[_models.Budget, IO], **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Is either a Budget type
+ or a IO type. Required.
+ :type parameters: ~azure.mgmt.costmanagement.models.Budget or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Budget] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Budget")
+
+ request = build_create_or_update_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self, scope: str, budget_name: str, **kwargs: Any
+ ) -> None:
+ """The operation to delete a budget.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ template_url=self.delete.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_cost_allocation_rules_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_cost_allocation_rules_operations.py
new file mode 100644
index 000000000000..56d7074de389
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_cost_allocation_rules_operations.py
@@ -0,0 +1,558 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ..._vendor import _convert_request
+from ...operations._cost_allocation_rules_operations import (
+ build_check_name_availability_request,
+ build_create_or_update_request,
+ build_delete_request,
+ build_get_request,
+ build_list_request,
+)
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class CostAllocationRulesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.aio.CostManagementClient`'s
+ :attr:`cost_allocation_rules` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(self, billing_account_id: str, **kwargs: Any) -> AsyncIterable["_models.CostAllocationRuleDefinition"]:
+ """Get the list of all cost allocation rules for a billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CostAllocationRuleDefinition or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.CostAllocationRuleList] = kwargs.pop("cls", None)
+
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ request = build_list_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+ request.method = "GET"
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("CostAllocationRuleList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ list.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules"
+ }
+
+ @overload
+ async def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: _models.CostAllocationRuleCheckNameAvailabilityRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Required.
+ :type cost_allocation_rule_check_name_availability_request:
+ ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Required.
+ :type cost_allocation_rule_check_name_availability_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: Union[
+ _models.CostAllocationRuleCheckNameAvailabilityRequest, IO
+ ],
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Is either a CostAllocationRuleCheckNameAvailabilityRequest type or a IO type.
+ Required.
+ :type cost_allocation_rule_check_name_availability_request:
+ ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.CostAllocationRuleCheckNameAvailabilityResponse] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(cost_allocation_rule_check_name_availability_request, (IOBase, bytes)):
+ _content = cost_allocation_rule_check_name_availability_request
+ else:
+ _json = self._serialize.body(
+ cost_allocation_rule_check_name_availability_request, "CostAllocationRuleCheckNameAvailabilityRequest"
+ )
+
+ request = build_check_name_availability_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.check_name_availability.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("CostAllocationRuleCheckNameAvailabilityResponse", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ check_name_availability.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/checkNameAvailability"
+ }
+
+ @distributed_trace_async
+ async def get(self, billing_account_id: str, rule_name: str, **kwargs: Any) -> _models.CostAllocationRuleDefinition:
+ """Get a cost allocation rule by rule name and billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.CostAllocationRuleDefinition] = kwargs.pop("cls", None)
+
+ request = build_get_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ template_url=self.get.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
+
+ @overload
+ async def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: _models.CostAllocationRuleDefinition,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Required.
+ :type cost_allocation_rule: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Required.
+ :type cost_allocation_rule: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: Union[_models.CostAllocationRuleDefinition, IO],
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Is either a
+ CostAllocationRuleDefinition type or a IO type. Required.
+ :type cost_allocation_rule: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition or
+ IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.CostAllocationRuleDefinition] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(cost_allocation_rule, (IOBase, bytes)):
+ _content = cost_allocation_rule
+ else:
+ _json = self._serialize.body(cost_allocation_rule, "CostAllocationRuleDefinition")
+
+ request = build_create_or_update_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self, billing_account_id: str, rule_name: str, **kwargs: Any
+ ) -> None:
+ """Delete cost allocation rule for billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ template_url=self.delete.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_operations.py
new file mode 100644
index 000000000000..abef553f7e38
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_operations.py
@@ -0,0 +1,1495 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ..._vendor import _convert_request
+from ...operations._generate_benefit_utilization_summaries_report_operations import (
+ build_generate_by_billing_account_request,
+ build_generate_by_billing_profile_request,
+ build_generate_by_reservation_id_request,
+ build_generate_by_reservation_order_id_request,
+ build_generate_by_savings_plan_id_request,
+ build_generate_by_savings_plan_order_id_request,
+)
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class GenerateBenefitUtilizationSummariesReportOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.aio.CostManagementClient`'s
+ :attr:`generate_benefit_utilization_summaries_report` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ async def _generate_by_billing_account_initial(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_billing_account_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_billing_account_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_billing_account_initial.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_billing_account_initial(
+ billing_account_id=billing_account_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_billing_account.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ async def _generate_by_billing_profile_initial(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_billing_profile_request(
+ billing_account_id=billing_account_id,
+ billing_profile_id=billing_profile_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_billing_profile_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_billing_profile_initial.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_billing_profile_initial(
+ billing_account_id=billing_account_id,
+ billing_profile_id=billing_profile_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_billing_profile.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ async def _generate_by_reservation_order_id_initial(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_reservation_order_id_request(
+ reservation_order_id=reservation_order_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_reservation_order_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_reservation_order_id_initial.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_reservation_order_id_initial(
+ reservation_order_id=reservation_order_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_reservation_order_id.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ async def _generate_by_reservation_id_initial(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_reservation_id_request(
+ reservation_order_id=reservation_order_id,
+ reservation_id=reservation_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_reservation_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_reservation_id_initial.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_reservation_id_initial(
+ reservation_order_id=reservation_order_id,
+ reservation_id=reservation_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_reservation_id.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ async def _generate_by_savings_plan_order_id_initial(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_savings_plan_order_id_request(
+ savings_plan_order_id=savings_plan_order_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_savings_plan_order_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_savings_plan_order_id_initial.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_savings_plan_order_id_initial(
+ savings_plan_order_id=savings_plan_order_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_savings_plan_order_id.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ async def _generate_by_savings_plan_id_initial(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_savings_plan_id_request(
+ savings_plan_order_id=savings_plan_order_id,
+ savings_plan_id=savings_plan_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_savings_plan_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_savings_plan_id_initial.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ async def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._generate_by_savings_plan_id_initial(
+ savings_plan_order_id=savings_plan_order_id,
+ savings_plan_id=savings_plan_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_savings_plan_id.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_cost_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_cost_details_report_operations.py
index 0c905cc94df4..aa660430030d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_cost_details_report_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_cost_details_report_operations.py
@@ -147,13 +147,14 @@ async def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Required.
:type parameters: ~azure.mgmt.costmanagement.models.GenerateCostDetailsReportRequestDefinition
@@ -190,13 +191,14 @@ async def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Required.
:type parameters: IO
@@ -233,13 +235,14 @@ async def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Is either a
GenerateCostDetailsReportRequestDefinition type or a IO type. Required.
@@ -369,8 +372,9 @@ async def begin_get_operation_results(
"""Get the result of the specified operation. This link is provided in the CostDetails creation
request response Location header.
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param operation_id: The target operation Id. Required.
:type operation_id: str
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py
index f9da4d617b6a..537ff7ec10dd 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py
@@ -121,7 +121,7 @@ async def begin_by_billing_account_id(
"""Generates the reservations details report for provided date range asynchronously based on
enrollment id. The Reservation usage details can be viewed only by certain enterprise roles.
For more details on the roles see,
- https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role.
+ https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
@@ -260,7 +260,7 @@ async def begin_by_billing_profile_id(
"""Generates the reservations details report for provided date range asynchronously by billing
profile. The Reservation usage details can be viewed by only certain enterprise roles by
default. For more details on the roles see,
- https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access.
+ https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py
new file mode 100644
index 000000000000..2a753b4b75af
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py
@@ -0,0 +1,399 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ..._vendor import _convert_request
+from ...operations._settings_operations import (
+ build_create_or_update_by_scope_request,
+ build_delete_by_scope_request,
+ build_get_by_scope_request,
+ build_list_request,
+)
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class SettingsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.aio.CostManagementClient`'s
+ :attr:`settings` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def list(self, scope: str, **kwargs: Any) -> _models.SettingsListResult:
+ """List all cost management settings in the requested scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SettingsListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.SettingsListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SettingsListResult] = kwargs.pop("cls", None)
+
+ request = build_list_request(
+ scope=scope,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SettingsListResult", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings"}
+
+ @overload
+ async def create_or_update_by_scope(
+ self,
+ scope: str,
+ type: Union[str, _models.SettingType],
+ setting: _models.Setting,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Required.
+ :type setting: ~azure.mgmt.costmanagement.models.Setting
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update_by_scope(
+ self,
+ scope: str,
+ type: Union[str, _models.SettingType],
+ setting: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Required.
+ :type setting: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def create_or_update_by_scope(
+ self, scope: str, type: Union[str, _models.SettingType], setting: Union[_models.Setting, IO], **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Is either a Setting type or a IO type.
+ Required.
+ :type setting: ~azure.mgmt.costmanagement.models.Setting or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Setting] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(setting, (IOBase, bytes)):
+ _content = setting
+ else:
+ _json = self._serialize.body(setting, "Setting")
+
+ request = build_create_or_update_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
+
+ @distributed_trace_async
+ async def get_by_scope(self, scope: str, type: Union[str, _models.SettingType], **kwargs: Any) -> _models.Setting:
+ """Get the setting from the given scope by name.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.Setting] = kwargs.pop("cls", None)
+
+ request = build_get_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ template_url=self.get_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
+
+ @distributed_trace_async
+ async def delete_by_scope( # pylint: disable=inconsistent-return-statements
+ self, scope: str, type: Union[str, _models.SettingType], **kwargs: Any
+ ) -> None:
+ """Delete a setting within the given scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ template_url=self.delete_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py
index be704298e815..fd17468b4957 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py
@@ -12,29 +12,50 @@
from ._models_py3 import AlertsResult
from ._models_py3 import AllSavingsBenefitDetails
from ._models_py3 import AllSavingsList
+from ._models_py3 import AsyncOperationStatusProperties
from ._models_py3 import BenefitRecommendationModel
from ._models_py3 import BenefitRecommendationProperties
from ._models_py3 import BenefitRecommendationsListResult
from ._models_py3 import BenefitResource
from ._models_py3 import BenefitUtilizationSummariesListResult
+from ._models_py3 import BenefitUtilizationSummariesOperationStatus
+from ._models_py3 import BenefitUtilizationSummariesRequest
from ._models_py3 import BenefitUtilizationSummary
from ._models_py3 import BenefitUtilizationSummaryProperties
from ._models_py3 import BlobInfo
+from ._models_py3 import Budget
+from ._models_py3 import BudgetComparisonExpression
+from ._models_py3 import BudgetFilter
+from ._models_py3 import BudgetFilterProperties
+from ._models_py3 import BudgetTimePeriod
+from ._models_py3 import BudgetsListResult
from ._models_py3 import CheckNameAvailabilityRequest
from ._models_py3 import CheckNameAvailabilityResponse
from ._models_py3 import CommonExportProperties
+from ._models_py3 import CostAllocationProportion
+from ._models_py3 import CostAllocationResource
+from ._models_py3 import CostAllocationRuleCheckNameAvailabilityRequest
+from ._models_py3 import CostAllocationRuleCheckNameAvailabilityResponse
+from ._models_py3 import CostAllocationRuleDefinition
+from ._models_py3 import CostAllocationRuleDetails
+from ._models_py3 import CostAllocationRuleList
+from ._models_py3 import CostAllocationRuleProperties
from ._models_py3 import CostDetailsOperationResults
from ._models_py3 import CostDetailsTimePeriod
from ._models_py3 import CostManagementOperation
from ._models_py3 import CostManagementProxyResource
from ._models_py3 import CostManagementResource
+from ._models_py3 import CurrentSpend
from ._models_py3 import Dimension
from ._models_py3 import DimensionsListResult
from ._models_py3 import DismissAlertPayload
from ._models_py3 import DownloadURL
+from ._models_py3 import ErrorAdditionalInfo
+from ._models_py3 import ErrorDetail
from ._models_py3 import ErrorDetails
from ._models_py3 import ErrorDetailsWithNestedDetails
from ._models_py3 import ErrorResponse
+from ._models_py3 import ErrorResponseAutoGenerated
from ._models_py3 import ErrorResponseWithNestedDetails
from ._models_py3 import Export
from ._models_py3 import ExportDataset
@@ -58,6 +79,7 @@
from ._models_py3 import ForecastDefinition
from ._models_py3 import ForecastFilter
from ._models_py3 import ForecastResult
+from ._models_py3 import ForecastSpend
from ._models_py3 import ForecastTimePeriod
from ._models_py3 import GenerateCostDetailsReportErrorResponse
from ._models_py3 import GenerateCostDetailsReportRequestDefinition
@@ -69,6 +91,7 @@
from ._models_py3 import IncludedQuantityUtilizationSummary
from ._models_py3 import IncludedQuantityUtilizationSummaryProperties
from ._models_py3 import KpiProperties
+from ._models_py3 import Notification
from ._models_py3 import NotificationProperties
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
@@ -102,10 +125,17 @@
from ._models_py3 import ScheduledAction
from ._models_py3 import ScheduledActionListResult
from ._models_py3 import ScheduledActionProxyResource
+from ._models_py3 import Setting
+from ._models_py3 import SettingsListResult
from ._models_py3 import SharedScopeBenefitRecommendationProperties
from ._models_py3 import SingleScopeBenefitRecommendationProperties
+from ._models_py3 import SourceCostAllocationResource
from ._models_py3 import Status
+from ._models_py3 import SystemAssignedServiceIdentity
from ._models_py3 import SystemData
+from ._models_py3 import TagInheritanceProperties
+from ._models_py3 import TagInheritanceSetting
+from ._models_py3 import TargetCostAllocationResource
from ._models_py3 import View
from ._models_py3 import ViewListResult
@@ -119,12 +149,19 @@
from ._cost_management_client_enums import AlertTimeGrainType
from ._cost_management_client_enums import AlertType
from ._cost_management_client_enums import BenefitKind
+from ._cost_management_client_enums import BenefitUtilizationSummaryReportSchema
+from ._cost_management_client_enums import BudgetNotificationOperatorType
+from ._cost_management_client_enums import BudgetOperatorType
+from ._cost_management_client_enums import CategoryType
from ._cost_management_client_enums import ChartType
from ._cost_management_client_enums import CheckNameAvailabilityReason
+from ._cost_management_client_enums import CostAllocationPolicyType
+from ._cost_management_client_enums import CostAllocationResourceType
from ._cost_management_client_enums import CostDetailsDataFormat
from ._cost_management_client_enums import CostDetailsMetricType
from ._cost_management_client_enums import CostDetailsStatusType
from ._cost_management_client_enums import CreatedByType
+from ._cost_management_client_enums import CultureCode
from ._cost_management_client_enums import DaysOfWeek
from ._cost_management_client_enums import ExecutionStatus
from ._cost_management_client_enums import ExecutionType
@@ -135,6 +172,7 @@
from ._cost_management_client_enums import ForecastTimeframe
from ._cost_management_client_enums import ForecastType
from ._cost_management_client_enums import FormatType
+from ._cost_management_client_enums import Frequency
from ._cost_management_client_enums import FunctionName
from ._cost_management_client_enums import FunctionType
from ._cost_management_client_enums import GenerateDetailedCostReportMetricType
@@ -150,6 +188,7 @@
from ._cost_management_client_enums import PivotType
from ._cost_management_client_enums import QueryColumnType
from ._cost_management_client_enums import QueryOperatorType
+from ._cost_management_client_enums import Reason
from ._cost_management_client_enums import RecurrenceType
from ._cost_management_client_enums import ReportConfigSortingType
from ._cost_management_client_enums import ReportGranularityType
@@ -157,12 +196,18 @@
from ._cost_management_client_enums import ReportTimeframeType
from ._cost_management_client_enums import ReportType
from ._cost_management_client_enums import ReservationReportSchema
+from ._cost_management_client_enums import RuleStatus
from ._cost_management_client_enums import ScheduleFrequency
from ._cost_management_client_enums import ScheduledActionKind
from ._cost_management_client_enums import ScheduledActionStatus
from ._cost_management_client_enums import Scope
+from ._cost_management_client_enums import SettingType
+from ._cost_management_client_enums import SettingsKind
from ._cost_management_client_enums import StatusType
+from ._cost_management_client_enums import SystemAssignedServiceIdentityType
from ._cost_management_client_enums import Term
+from ._cost_management_client_enums import ThresholdType
+from ._cost_management_client_enums import TimeGrainType
from ._cost_management_client_enums import TimeframeType
from ._cost_management_client_enums import WeeksOfMonth
from ._patch import __all__ as _patch_all
@@ -176,29 +221,50 @@
"AlertsResult",
"AllSavingsBenefitDetails",
"AllSavingsList",
+ "AsyncOperationStatusProperties",
"BenefitRecommendationModel",
"BenefitRecommendationProperties",
"BenefitRecommendationsListResult",
"BenefitResource",
"BenefitUtilizationSummariesListResult",
+ "BenefitUtilizationSummariesOperationStatus",
+ "BenefitUtilizationSummariesRequest",
"BenefitUtilizationSummary",
"BenefitUtilizationSummaryProperties",
"BlobInfo",
+ "Budget",
+ "BudgetComparisonExpression",
+ "BudgetFilter",
+ "BudgetFilterProperties",
+ "BudgetTimePeriod",
+ "BudgetsListResult",
"CheckNameAvailabilityRequest",
"CheckNameAvailabilityResponse",
"CommonExportProperties",
+ "CostAllocationProportion",
+ "CostAllocationResource",
+ "CostAllocationRuleCheckNameAvailabilityRequest",
+ "CostAllocationRuleCheckNameAvailabilityResponse",
+ "CostAllocationRuleDefinition",
+ "CostAllocationRuleDetails",
+ "CostAllocationRuleList",
+ "CostAllocationRuleProperties",
"CostDetailsOperationResults",
"CostDetailsTimePeriod",
"CostManagementOperation",
"CostManagementProxyResource",
"CostManagementResource",
+ "CurrentSpend",
"Dimension",
"DimensionsListResult",
"DismissAlertPayload",
"DownloadURL",
+ "ErrorAdditionalInfo",
+ "ErrorDetail",
"ErrorDetails",
"ErrorDetailsWithNestedDetails",
"ErrorResponse",
+ "ErrorResponseAutoGenerated",
"ErrorResponseWithNestedDetails",
"Export",
"ExportDataset",
@@ -222,6 +288,7 @@
"ForecastDefinition",
"ForecastFilter",
"ForecastResult",
+ "ForecastSpend",
"ForecastTimePeriod",
"GenerateCostDetailsReportErrorResponse",
"GenerateCostDetailsReportRequestDefinition",
@@ -233,6 +300,7 @@
"IncludedQuantityUtilizationSummary",
"IncludedQuantityUtilizationSummaryProperties",
"KpiProperties",
+ "Notification",
"NotificationProperties",
"Operation",
"OperationDisplay",
@@ -266,10 +334,17 @@
"ScheduledAction",
"ScheduledActionListResult",
"ScheduledActionProxyResource",
+ "Setting",
+ "SettingsListResult",
"SharedScopeBenefitRecommendationProperties",
"SingleScopeBenefitRecommendationProperties",
+ "SourceCostAllocationResource",
"Status",
+ "SystemAssignedServiceIdentity",
"SystemData",
+ "TagInheritanceProperties",
+ "TagInheritanceSetting",
+ "TargetCostAllocationResource",
"View",
"ViewListResult",
"AccumulatedType",
@@ -282,12 +357,19 @@
"AlertTimeGrainType",
"AlertType",
"BenefitKind",
+ "BenefitUtilizationSummaryReportSchema",
+ "BudgetNotificationOperatorType",
+ "BudgetOperatorType",
+ "CategoryType",
"ChartType",
"CheckNameAvailabilityReason",
+ "CostAllocationPolicyType",
+ "CostAllocationResourceType",
"CostDetailsDataFormat",
"CostDetailsMetricType",
"CostDetailsStatusType",
"CreatedByType",
+ "CultureCode",
"DaysOfWeek",
"ExecutionStatus",
"ExecutionType",
@@ -298,6 +380,7 @@
"ForecastTimeframe",
"ForecastType",
"FormatType",
+ "Frequency",
"FunctionName",
"FunctionType",
"GenerateDetailedCostReportMetricType",
@@ -313,6 +396,7 @@
"PivotType",
"QueryColumnType",
"QueryOperatorType",
+ "Reason",
"RecurrenceType",
"ReportConfigSortingType",
"ReportGranularityType",
@@ -320,12 +404,18 @@
"ReportTimeframeType",
"ReportType",
"ReservationReportSchema",
+ "RuleStatus",
"ScheduleFrequency",
"ScheduledActionKind",
"ScheduledActionStatus",
"Scope",
+ "SettingType",
+ "SettingsKind",
"StatusType",
+ "SystemAssignedServiceIdentityType",
"Term",
+ "ThresholdType",
+ "TimeGrainType",
"TimeframeType",
"WeeksOfMonth",
]
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py
index 400e59765fb6..10c2fe673459 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py
@@ -114,6 +114,87 @@ class BenefitKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Benefit is SavingsPlan."""
+class BenefitUtilizationSummaryReportSchema(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The CSV file from the reportUrl and secondaryReportUrl blob link will consist of the following
+ columns of benefit utilization data. UtilizedPercentage will be 0 for savings plans reports and
+ non data bricks reservations. Utilization percentages will be 0 for data bricks reservations.
+ """
+
+ KIND = "Kind"
+ AVG_UTILIZATION_PERCENTAGE = "AvgUtilizationPercentage"
+ BENEFIT_ORDER_ID = "BenefitOrderId"
+ BENEFIT_ID = "BenefitId"
+ BENEFIT_TYPE = "BenefitType"
+ MAX_UTILIZATION_PERCENTAGE = "MaxUtilizationPercentage"
+ MIN_UTILIZATION_PERCENTAGE = "MinUtilizationPercentage"
+ USAGE_DATE = "UsageDate"
+ UTILIZED_PERCENTAGE = "UtilizedPercentage"
+
+
+class BudgetNotificationOperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The comparison operator.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported operators for **CategoryType: Cost**
+
+
+ * GreaterThan
+ *
+ GreaterThanOrEqualTo
+
+ Supported operators for **CategoryType: ReservationUtilization**
+
+ * LessThan.
+ """
+
+ EQUAL_TO = "EqualTo"
+ """Notification will be triggered if the evaluated cost is the same as threshold value. Note: It’s
+ #: not recommended to use this OperatorType as there’s low chance of cost being exactly the same
+ #: as threshold value, leading to missing of your alert. This OperatorType will be deprecated in
+ #: future.
+ #:
+ #: Supported for CategoryType(s): Cost."""
+ GREATER_THAN = "GreaterThan"
+ """Notification will be triggered if the evaluated cost is greater than the threshold value. Note:
+ #: This is the recommended OperatorType while configuring Budget Alert.
+ #:
+ #: Supported for CategoryType(s): Cost."""
+ GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo"
+ """Notification will be triggered if the evaluated cost is greater than or equal to the threshold
+ #: value.
+ #:
+ #: Supported for CategoryType(s): Cost."""
+ LESS_THAN = "LessThan"
+ """Notification will be triggered if any Reservations in the scope of the Reservation Utilization
+ #: Alert Rule have a utilization less than the threshold percentage.
+ #:
+ #: Supported for CategoryType(s): ReservationUtilization."""
+
+
+class BudgetOperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The operator to use for comparison."""
+
+ IN = "In"
+ IN_ENUM = "In"
+
+
+class CategoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The category of the budget.
+
+
+ * 'Cost' defines a Budget.
+ * 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
+ """
+
+ COST = "Cost"
+ """A Budget that evaluates monetary cost of Azure resources against an amount, and alerts based on
+ #: a configured notification threshold."""
+ RESERVATION_UTILIZATION = "ReservationUtilization"
+ """An Alert Rule that evaluates the utilization percentage of Azure Reservations, and alerts based
+ #: on a configured notification threshold."""
+
+
class ChartType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Chart type of the main view in Cost Analysis. Required."""
@@ -131,6 +212,24 @@ class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ALREADY_EXISTS = "AlreadyExists"
+class CostAllocationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Method to use for allocating cost. FixedProportion indicates that cost will be split based on
+ specified percentage values.
+ """
+
+ FIXED_PROPORTION = "FixedProportion"
+
+
+class CostAllocationResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Category of resource to use for allocation."""
+
+ DIMENSION = "Dimension"
+ """Indicates an Azure dimension such as a subscription id or resource group name is being used for
+ #: allocation."""
+ TAG = "Tag"
+ """Allocates cost based on Azure Tag key value pairs."""
+
+
class CostDetailsDataFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The data format of the report."""
@@ -167,6 +266,35 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
KEY = "Key"
+class CultureCode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Language in which the recipient will receive the notification,
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+ """
+
+ EN_US = "en-us"
+ JA_JP = "ja-jp"
+ ZH_CN = "zh-cn"
+ DE_DE = "de-de"
+ ES_ES = "es-es"
+ FR_FR = "fr-fr"
+ IT_IT = "it-it"
+ KO_KR = "ko-kr"
+ PT_BR = "pt-br"
+ RU_RU = "ru-ru"
+ ZH_TW = "zh-tw"
+ CS_CZ = "cs-cz"
+ PL_PL = "pl-pl"
+ TR_TR = "tr-tr"
+ DA_DK = "da-dk"
+ EN_GB = "en-gb"
+ HU_HU = "hu-hu"
+ NB_NO = "nb-no"
+ NL_NL = "nl-nl"
+ PT_PT = "pt-pt"
+ SV_SE = "sv-se"
+
+
class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Days of Week."""
@@ -199,7 +327,9 @@ class ExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class ExportType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The type of the query."""
+ """The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to
+ exports that do not yet provide data for charges or amortization for service reservations.
+ """
USAGE = "Usage"
ACTUAL_COST = "ActualCost"
@@ -246,6 +376,26 @@ class FormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
CSV = "Csv"
+class Frequency(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Frequency of a notification. Represents how long the notification will be silent after
+ triggering an alert for a threshold breach. If not specified, the frequency will be set by
+ default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain:
+ Last30Days).
+
+ Supported for CategoryType(s): ReservationUtilization.
+ """
+
+ DAILY = "Daily"
+ """After the threshold breaches and an Alert is fired, no further alerts will be sent until the
+ #: next calendar day."""
+ WEEKLY = "Weekly"
+ """After the threshold breaches and an Alert is fired, no further alerts will be sent for 7
+ #: calendar days."""
+ MONTHLY = "Monthly"
+ """After the threshold breaches and an Alert is fired, no further alerts will be sent for 30
+ #: calendar days."""
+
+
class FunctionName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The name of the column to aggregate."""
@@ -291,7 +441,7 @@ class GrainParameter(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class GranularityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The granularity of rows in the forecast."""
+ """The granularity of rows in the export. Currently only 'Daily' is supported."""
DAILY = "Daily"
@@ -323,11 +473,12 @@ class MetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class OperationStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The status of the long running operation."""
+ """Enum representing the status of an async operation."""
RUNNING = "Running"
- COMPLETED = "Completed"
+ COMPLETE = "Complete"
FAILED = "Failed"
+ COMPLETED = "Completed"
class OperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -371,6 +522,14 @@ class QueryOperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
IN_ENUM = "In"
+class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The reason this name is not available."""
+
+ INVALID = "Invalid"
+ ALREADY_EXISTS = "AlreadyExists"
+ VALID = "Valid"
+
+
class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The schedule recurrence."""
@@ -444,6 +603,18 @@ class ReservationReportSchema(str, Enum, metaclass=CaseInsensitiveEnumMeta):
USED_HOURS = "UsedHours"
+class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Current status of the rule."""
+
+ NOT_ACTIVE = "NotActive"
+ """Rule is saved but not used to allocate costs."""
+ ACTIVE = "Active"
+ """Rule is saved and impacting cost allocation."""
+ PROCESSING = "Processing"
+ """Rule is saved and cost allocation is being updated. Readonly value that cannot be submitted in
+ #: a put request."""
+
+
class ScheduledActionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Kind of the scheduled action."""
@@ -485,6 +656,20 @@ class Scope(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Shared scope recommendation."""
+class SettingsKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Specifies the kind of settings."""
+
+ TAGINHERITANCE = "taginheritance"
+
+
+class SettingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """SettingType."""
+
+ TAGINHERITANCE = "taginheritance"
+ """This setting applies, all the resource group and subscription tags to usage data of child
+ #: resources. Inherited tags will be seen within 24 hours for the current month's usage data."""
+
+
class StatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the export's schedule. If 'Inactive', the export's schedule is paused."""
@@ -492,6 +677,13 @@ class StatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
INACTIVE = "Inactive"
+class SystemAssignedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of managed service identity (either system assigned, or none)."""
+
+ NONE = "None"
+ SYSTEM_ASSIGNED = "SystemAssigned"
+
+
class Term(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Grain which corresponds to value."""
@@ -501,8 +693,21 @@ class Term(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Benefit term is 3 years."""
+class ThresholdType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of threshold.
+
+ Supported for CategoryType(s): Cost.
+ """
+
+ ACTUAL = "Actual"
+ """Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget."""
+ FORECASTED = "Forecasted"
+ """Forecasted costs budget alerts provide advanced notification that your spending trends are
+ #: likely to exceed your allocated budget, as it relies on forecasted cost predictions."""
+
+
class TimeframeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The time frame for pulling data for the query. If custom, then a specific time period must be
+ """The time frame for pulling data for the export. If custom, then a specific time period must be
provided.
"""
@@ -514,6 +719,69 @@ class TimeframeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
CUSTOM = "Custom"
+class TimeGrainType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The time covered by a budget. Tracking of the amount will be reset based on the time grain.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported timeGrainTypes for **CategoryType: Cost**
+
+
+ * Monthly
+ * Quarterly
+ * Annually
+ * BillingMonth*
+ * BillingQuarter*
+ *
+ BillingAnnual*
+
+ *only supported for Web Direct customers.
+
+ Supported timeGrainTypes for **CategoryType: ReservationUtilization**
+
+ * Last7Days
+ *
+ Last30Days
+
+ Required for CategoryType(s): Cost, ReservationUtilization.
+ """
+
+ MONTHLY = "Monthly"
+ """The budget will track costs in the current calendar month against the amount.
+ #:
+ #: Supported for CategoryType: Cost only."""
+ QUARTERLY = "Quarterly"
+ """The budget will track costs in the current calendar quarter against the amount.
+ #:
+ #: Supported for CategoryType: Cost only."""
+ ANNUALLY = "Annually"
+ """The budget will track costs in the current calendar year against the amount.
+ #:
+ #: Supported for CategoryType: Cost only."""
+ BILLING_MONTH = "BillingMonth"
+ """The budget will track costs in the current billing month against the amount.
+ #:
+ #: Supported for CategoryType: Cost and Web Direct customers only."""
+ BILLING_QUARTER = "BillingQuarter"
+ """The budget will track costs in the current billing quarter against the amount.
+ #:
+ #: Supported for CategoryType: Cost and Web Direct customers only."""
+ BILLING_ANNUAL = "BillingAnnual"
+ """The budget will track costs in the current billing year against the amount.
+ #:
+ #: Supported for CategoryType: Cost and Web Direct customers only."""
+ LAST7_DAYS = "Last7Days"
+ """The Reservation Utilization Alert Rule will evaluate reservations based on their 7-Day
+ #: utilization percentage.
+ #:
+ #: Supported for CategoryType: ReservationUtilization only."""
+ LAST30_DAYS = "Last30Days"
+ """The Reservation Utilization Alert Rule will evaluate reservations based on their 30-Day
+ #: utilization percentage.
+ #:
+ #: Supported for CategoryType: ReservationUtilization only."""
+
+
class WeeksOfMonth(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Weeks of month."""
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py
index e4bc3e9da52b..c25f952afd4d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py
@@ -540,6 +540,63 @@ def __init__(self, **kwargs: Any) -> None:
self.next_link = None
+class AsyncOperationStatusProperties(_serialization.Model):
+ """Object representing the report url and valid until date of the async report generated.
+
+ :ivar report_url: Sas url to the async benefit utilization summaries report. Will be empty if
+ the report is in Running or Failed state. Known values are: "Kind", "AvgUtilizationPercentage",
+ "BenefitOrderId", "BenefitId", "BenefitType", "MaxUtilizationPercentage",
+ "MinUtilizationPercentage", "UsageDate", and "UtilizedPercentage".
+ :vartype report_url: str or
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummaryReportSchema
+ :ivar secondary_report_url: Sas url to async benefit utilization summaries report in secondary
+ storage in case of primary outage. Will be empty if the report is in Running or Failed state.
+ Known values are: "Kind", "AvgUtilizationPercentage", "BenefitOrderId", "BenefitId",
+ "BenefitType", "MaxUtilizationPercentage", "MinUtilizationPercentage", "UsageDate", and
+ "UtilizedPercentage".
+ :vartype secondary_report_url: str or
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummaryReportSchema
+ :ivar valid_until: The date that the sas url provided in reportUrl expires.
+ :vartype valid_until: ~datetime.datetime
+ """
+
+ _attribute_map = {
+ "report_url": {"key": "reportUrl", "type": "str"},
+ "secondary_report_url": {"key": "secondaryReportUrl", "type": "str"},
+ "valid_until": {"key": "validUntil", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ report_url: Optional[Union[str, "_models.BenefitUtilizationSummaryReportSchema"]] = None,
+ secondary_report_url: Optional[Union[str, "_models.BenefitUtilizationSummaryReportSchema"]] = None,
+ valid_until: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword report_url: Sas url to the async benefit utilization summaries report. Will be empty
+ if the report is in Running or Failed state. Known values are: "Kind",
+ "AvgUtilizationPercentage", "BenefitOrderId", "BenefitId", "BenefitType",
+ "MaxUtilizationPercentage", "MinUtilizationPercentage", "UsageDate", and "UtilizedPercentage".
+ :paramtype report_url: str or
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummaryReportSchema
+ :keyword secondary_report_url: Sas url to async benefit utilization summaries report in
+ secondary storage in case of primary outage. Will be empty if the report is in Running or
+ Failed state. Known values are: "Kind", "AvgUtilizationPercentage", "BenefitOrderId",
+ "BenefitId", "BenefitType", "MaxUtilizationPercentage", "MinUtilizationPercentage",
+ "UsageDate", and "UtilizedPercentage".
+ :paramtype secondary_report_url: str or
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummaryReportSchema
+ :keyword valid_until: The date that the sas url provided in reportUrl expires.
+ :paramtype valid_until: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ self.report_url = report_url
+ self.secondary_report_url = secondary_report_url
+ self.valid_until = valid_until
+
+
class Resource(_serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
@@ -848,6 +905,154 @@ def __init__(self, **kwargs: Any) -> None:
self.next_link = None
+class BenefitUtilizationSummariesOperationStatus(_serialization.Model):
+ """Status of a benefit utilization summaries report. Provides Async Benefit Utilization Summaries
+ Request input, status, and report sas url.
+
+ :ivar input: Input given to create the benefit utilization summaries report.
+ :vartype input: ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :ivar status: The status of the creation of the benefit utilization summaries report. Known
+ values are: "Running", "Complete", "Failed", and "Completed".
+ :vartype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType
+ :ivar properties: Contains sas url to the async benefit utilization summaries report and a date
+ that the url is valid until. These values will be empty if the report is in a Running or Failed
+ state.
+ :vartype properties: ~azure.mgmt.costmanagement.models.AsyncOperationStatusProperties
+ """
+
+ _attribute_map = {
+ "input": {"key": "input", "type": "BenefitUtilizationSummariesRequest"},
+ "status": {"key": "status", "type": "str"},
+ "properties": {"key": "properties", "type": "AsyncOperationStatusProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ input: Optional["_models.BenefitUtilizationSummariesRequest"] = None,
+ status: Optional[Union[str, "_models.OperationStatusType"]] = None,
+ properties: Optional["_models.AsyncOperationStatusProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword input: Input given to create the benefit utilization summaries report.
+ :paramtype input: ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword status: The status of the creation of the benefit utilization summaries report. Known
+ values are: "Running", "Complete", "Failed", and "Completed".
+ :paramtype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType
+ :keyword properties: Contains sas url to the async benefit utilization summaries report and a
+ date that the url is valid until. These values will be empty if the report is in a Running or
+ Failed state.
+ :paramtype properties: ~azure.mgmt.costmanagement.models.AsyncOperationStatusProperties
+ """
+ super().__init__(**kwargs)
+ self.input = input
+ self.status = status
+ self.properties = properties
+
+
+class BenefitUtilizationSummariesRequest(_serialization.Model):
+ """Properties of an async benefit utilization summaries request.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar billing_account_id: Billing account the benefit utilization summaries report is for.
+ Required for billing account and billing profile scopes. Not supported for any benefit scopes.
+ :vartype billing_account_id: str
+ :ivar billing_profile_id: Billing profile id the benefit utilization summaries report is for.
+ Required for billing profile scope. Not supported for billing account or any benefit scopes.
+ :vartype billing_profile_id: str
+ :ivar benefit_order_id: Benefit order id the benefit utilization summaries report is for.
+ Required for benefit order and benefit id scopes. Not supported for any billing scopes.
+ :vartype benefit_order_id: str
+ :ivar benefit_id: Benefit id the benefit utilization summaries report is for. Required for
+ benefit id scope. Not supported for benefit order or any billing scopes.
+ :vartype benefit_id: str
+ :ivar grain: The grain the summaries data is served at in the report. Accepted values are
+ 'Daily' or 'Monthly'. Required. Known values are: "Hourly", "Daily", and "Monthly".
+ :vartype grain: str or ~azure.mgmt.costmanagement.models.Grain
+ :ivar start_date: The start date of the summaries data that will be served in the report.
+ Required.
+ :vartype start_date: ~datetime.datetime
+ :ivar end_date: The end date of the summaries data that will be served in the report. Required.
+ :vartype end_date: ~datetime.datetime
+ :ivar kind: The type of benefit data requested. Required for billing account and billing
+ profile scopes. Implied and not to be passed at benefit scopes. Supported values are
+ Reservation and SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and
+ "SavingsPlan".
+ :vartype kind: str or ~azure.mgmt.costmanagement.models.BenefitKind
+ """
+
+ _validation = {
+ "grain": {"required": True},
+ "start_date": {"required": True},
+ "end_date": {"required": True},
+ }
+
+ _attribute_map = {
+ "billing_account_id": {"key": "billingAccountId", "type": "str"},
+ "billing_profile_id": {"key": "billingProfileId", "type": "str"},
+ "benefit_order_id": {"key": "benefitOrderId", "type": "str"},
+ "benefit_id": {"key": "benefitId", "type": "str"},
+ "grain": {"key": "grain", "type": "str"},
+ "start_date": {"key": "startDate", "type": "iso-8601"},
+ "end_date": {"key": "endDate", "type": "iso-8601"},
+ "kind": {"key": "kind", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ grain: Union[str, "_models.Grain"],
+ start_date: datetime.datetime,
+ end_date: datetime.datetime,
+ billing_account_id: Optional[str] = None,
+ billing_profile_id: Optional[str] = None,
+ benefit_order_id: Optional[str] = None,
+ benefit_id: Optional[str] = None,
+ kind: Optional[Union[str, "_models.BenefitKind"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword billing_account_id: Billing account the benefit utilization summaries report is for.
+ Required for billing account and billing profile scopes. Not supported for any benefit scopes.
+ :paramtype billing_account_id: str
+ :keyword billing_profile_id: Billing profile id the benefit utilization summaries report is
+ for. Required for billing profile scope. Not supported for billing account or any benefit
+ scopes.
+ :paramtype billing_profile_id: str
+ :keyword benefit_order_id: Benefit order id the benefit utilization summaries report is for.
+ Required for benefit order and benefit id scopes. Not supported for any billing scopes.
+ :paramtype benefit_order_id: str
+ :keyword benefit_id: Benefit id the benefit utilization summaries report is for. Required for
+ benefit id scope. Not supported for benefit order or any billing scopes.
+ :paramtype benefit_id: str
+ :keyword grain: The grain the summaries data is served at in the report. Accepted values are
+ 'Daily' or 'Monthly'. Required. Known values are: "Hourly", "Daily", and "Monthly".
+ :paramtype grain: str or ~azure.mgmt.costmanagement.models.Grain
+ :keyword start_date: The start date of the summaries data that will be served in the report.
+ Required.
+ :paramtype start_date: ~datetime.datetime
+ :keyword end_date: The end date of the summaries data that will be served in the report.
+ Required.
+ :paramtype end_date: ~datetime.datetime
+ :keyword kind: The type of benefit data requested. Required for billing account and billing
+ profile scopes. Implied and not to be passed at benefit scopes. Supported values are
+ Reservation and SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and
+ "SavingsPlan".
+ :paramtype kind: str or ~azure.mgmt.costmanagement.models.BenefitKind
+ """
+ super().__init__(**kwargs)
+ self.billing_account_id = billing_account_id
+ self.billing_profile_id = billing_profile_id
+ self.benefit_order_id = benefit_order_id
+ self.benefit_id = benefit_id
+ self.grain = grain
+ self.start_date = start_date
+ self.end_date = end_date
+ self.kind = kind
+
+
class BenefitUtilizationSummary(Resource):
"""Benefit utilization summary resource.
@@ -972,145 +1177,927 @@ def __init__(self, *, blob_link: Optional[str] = None, byte_count: Optional[int]
self.byte_count = byte_count
-class CheckNameAvailabilityRequest(_serialization.Model):
- """The check availability request body.
+class Budget(CostManagementProxyResource): # pylint: disable=too-many-instance-attributes
+ """A budget resource.
- :ivar name: The name of the resource for which availability needs to be checked.
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Resource Id.
+ :vartype id: str
+ :ivar name: Resource name.
:vartype name: str
- :ivar type: The resource type.
+ :ivar type: Resource type.
:vartype type: str
+ :ivar e_tag: 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.
+ :vartype e_tag: str
+ :ivar category: The category of the budget.
+
+
+ * 'Cost' defines a Budget.
+ * 'ReservationUtilization' defines a Reservation Utilization Alert Rule. Known values are:
+ "Cost" and "ReservationUtilization".
+ :vartype category: str or ~azure.mgmt.costmanagement.models.CategoryType
+ :ivar amount: The total amount of cost to track with the budget.
+
+ Supported for CategoryType(s): Cost.
+
+ Required for CategoryType(s): Cost.
+ :vartype amount: float
+ :ivar time_grain: The time covered by a budget. Tracking of the amount will be reset based on
+ the time grain.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported timeGrainTypes for **CategoryType: Cost**
+
+
+ * Monthly
+ * Quarterly
+ * Annually
+ * BillingMonth*
+ * BillingQuarter*
+ *
+ BillingAnnual*
+
+ *only supported for Web Direct customers.
+
+ Supported timeGrainTypes for **CategoryType: ReservationUtilization**
+
+ * Last7Days
+ *
+ Last30Days
+
+ Required for CategoryType(s): Cost, ReservationUtilization. Known values are: "Monthly",
+ "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual", "Last7Days", and
+ "Last30Days".
+ :vartype time_grain: str or ~azure.mgmt.costmanagement.models.TimeGrainType
+ :ivar time_period: The time period that defines the active period of the budget. The budget
+ will evaluate data on or after the startDate and will expire on the endDate.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Required for CategoryType(s): Cost, ReservationUtilization.
+ :vartype time_period: ~azure.mgmt.costmanagement.models.BudgetTimePeriod
+ :ivar filter: May be used to filter budgets by user-specified dimensions and/or tags.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+ :vartype filter: ~azure.mgmt.costmanagement.models.BudgetFilter
+ :ivar current_spend: The current amount of cost which is being tracked for a budget.
+
+ Supported for CategoryType(s): Cost.
+ :vartype current_spend: ~azure.mgmt.costmanagement.models.CurrentSpend
+ :ivar notifications: Dictionary of notifications associated with the budget.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+
+ * Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with
+ thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
+ * Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed.
+ thresholdType is not applicable.
+ :vartype notifications: dict[str, ~azure.mgmt.costmanagement.models.Notification]
+ :ivar forecast_spend: The forecasted cost which is being tracked for a budget.
+
+ Supported for CategoryType(s): Cost.
+ :vartype forecast_spend: ~azure.mgmt.costmanagement.models.ForecastSpend
"""
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "current_spend": {"readonly": True},
+ "forecast_spend": {"readonly": True},
+ }
+
_attribute_map = {
+ "id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
+ "e_tag": {"key": "eTag", "type": "str"},
+ "category": {"key": "properties.category", "type": "str"},
+ "amount": {"key": "properties.amount", "type": "float"},
+ "time_grain": {"key": "properties.timeGrain", "type": "str"},
+ "time_period": {"key": "properties.timePeriod", "type": "BudgetTimePeriod"},
+ "filter": {"key": "properties.filter", "type": "BudgetFilter"},
+ "current_spend": {"key": "properties.currentSpend", "type": "CurrentSpend"},
+ "notifications": {"key": "properties.notifications", "type": "{Notification}"},
+ "forecast_spend": {"key": "properties.forecastSpend", "type": "ForecastSpend"},
}
- def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None:
+ def __init__(
+ self,
+ *,
+ e_tag: Optional[str] = None,
+ category: Optional[Union[str, "_models.CategoryType"]] = None,
+ amount: Optional[float] = None,
+ time_grain: Optional[Union[str, "_models.TimeGrainType"]] = None,
+ time_period: Optional["_models.BudgetTimePeriod"] = None,
+ filter: Optional["_models.BudgetFilter"] = None, # pylint: disable=redefined-builtin
+ notifications: Optional[Dict[str, "_models.Notification"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword name: The name of the resource for which availability needs to be checked.
+ :keyword e_tag: 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.
+ :paramtype e_tag: str
+ :keyword category: The category of the budget.
+
+
+ * 'Cost' defines a Budget.
+ * 'ReservationUtilization' defines a Reservation Utilization Alert Rule. Known values are:
+ "Cost" and "ReservationUtilization".
+ :paramtype category: str or ~azure.mgmt.costmanagement.models.CategoryType
+ :keyword amount: The total amount of cost to track with the budget.
+
+ Supported for CategoryType(s): Cost.
+
+ Required for CategoryType(s): Cost.
+ :paramtype amount: float
+ :keyword time_grain: The time covered by a budget. Tracking of the amount will be reset based
+ on the time grain.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported timeGrainTypes for **CategoryType: Cost**
+
+
+ * Monthly
+ * Quarterly
+ * Annually
+ * BillingMonth*
+ * BillingQuarter*
+ *
+ BillingAnnual*
+
+ *only supported for Web Direct customers.
+
+ Supported timeGrainTypes for **CategoryType: ReservationUtilization**
+
+ * Last7Days
+ *
+ Last30Days
+
+ Required for CategoryType(s): Cost, ReservationUtilization. Known values are: "Monthly",
+ "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual", "Last7Days", and
+ "Last30Days".
+ :paramtype time_grain: str or ~azure.mgmt.costmanagement.models.TimeGrainType
+ :keyword time_period: The time period that defines the active period of the budget. The budget
+ will evaluate data on or after the startDate and will expire on the endDate.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Required for CategoryType(s): Cost, ReservationUtilization.
+ :paramtype time_period: ~azure.mgmt.costmanagement.models.BudgetTimePeriod
+ :keyword filter: May be used to filter budgets by user-specified dimensions and/or tags.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+ :paramtype filter: ~azure.mgmt.costmanagement.models.BudgetFilter
+ :keyword notifications: Dictionary of notifications associated with the budget.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+
+ * Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with
+ thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
+ * Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed.
+ thresholdType is not applicable.
+ :paramtype notifications: dict[str, ~azure.mgmt.costmanagement.models.Notification]
+ """
+ super().__init__(e_tag=e_tag, **kwargs)
+ self.category = category
+ self.amount = amount
+ self.time_grain = time_grain
+ self.time_period = time_period
+ self.filter = filter
+ self.current_spend = None
+ self.notifications = notifications
+ self.forecast_spend = None
+
+
+class BudgetComparisonExpression(_serialization.Model):
+ """The comparison expression to be used in the budgets.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar name: The name of the column to use in comparison. Required.
+ :vartype name: str
+ :ivar operator: The operator to use for comparison. Required. Known values are: "In" and "In".
+ :vartype operator: str or ~azure.mgmt.costmanagement.models.BudgetOperatorType
+ :ivar values: Array of values to use for comparison. Required.
+ :vartype values: list[str]
+ """
+
+ _validation = {
+ "name": {"required": True},
+ "operator": {"required": True},
+ "values": {"required": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "operator": {"key": "operator", "type": "str"},
+ "values": {"key": "values", "type": "[str]"},
+ }
+
+ def __init__(
+ self, *, name: str, operator: Union[str, "_models.BudgetOperatorType"], values: List[str], **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The name of the column to use in comparison. Required.
:paramtype name: str
- :keyword type: The resource type.
- :paramtype type: str
+ :keyword operator: The operator to use for comparison. Required. Known values are: "In" and
+ "In".
+ :paramtype operator: str or ~azure.mgmt.costmanagement.models.BudgetOperatorType
+ :keyword values: Array of values to use for comparison. Required.
+ :paramtype values: list[str]
"""
super().__init__(**kwargs)
self.name = name
- self.type = type
+ self.operator = operator
+ self.values = values
-class CheckNameAvailabilityResponse(_serialization.Model):
- """The check availability result.
+class BudgetFilter(_serialization.Model):
+ """May be used to filter budgets by user-specified dimensions and/or tags.
- :ivar name_available: Indicates if the resource name is available.
- :vartype name_available: bool
- :ivar reason: The reason why the given name is not available. Known values are: "Invalid" and
- "AlreadyExists".
- :vartype reason: str or ~azure.mgmt.costmanagement.models.CheckNameAvailabilityReason
- :ivar message: Detailed reason why the given name is available.
- :vartype message: str
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ :ivar and_property: The logical "AND" expression. Must have at least 2 items.
+
+ Supported for CategoryType(s): Cost.
+ :vartype and_property: list[~azure.mgmt.costmanagement.models.BudgetFilterProperties]
+ :ivar dimensions: Has comparison expression for a dimension.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported dimension names for **CategoryType: ReservationUtilization**
+
+
+ * ReservationId
+ * ReservedResourceType.
+ :vartype dimensions: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ :ivar tags: Has comparison expression for a tag.
+
+ Supported for CategoryType(s): Cost.
+ :vartype tags: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ """
+
+ _attribute_map = {
+ "and_property": {"key": "and", "type": "[BudgetFilterProperties]"},
+ "dimensions": {"key": "dimensions", "type": "BudgetComparisonExpression"},
+ "tags": {"key": "tags", "type": "BudgetComparisonExpression"},
+ }
+
+ def __init__(
+ self,
+ *,
+ and_property: Optional[List["_models.BudgetFilterProperties"]] = None,
+ dimensions: Optional["_models.BudgetComparisonExpression"] = None,
+ tags: Optional["_models.BudgetComparisonExpression"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword and_property: The logical "AND" expression. Must have at least 2 items.
+
+ Supported for CategoryType(s): Cost.
+ :paramtype and_property: list[~azure.mgmt.costmanagement.models.BudgetFilterProperties]
+ :keyword dimensions: Has comparison expression for a dimension.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported dimension names for **CategoryType: ReservationUtilization**
+
+
+ * ReservationId
+ * ReservedResourceType.
+ :paramtype dimensions: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ :keyword tags: Has comparison expression for a tag.
+
+ Supported for CategoryType(s): Cost.
+ :paramtype tags: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ """
+ super().__init__(**kwargs)
+ self.and_property = and_property
+ self.dimensions = dimensions
+ self.tags = tags
+
+
+class BudgetFilterProperties(_serialization.Model):
+ """The Dimensions or Tags to filter a budget by.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ :ivar dimensions: Has comparison expression for a dimension.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported dimension names for **CategoryType: ReservationUtilization**
+
+
+ * ReservationId
+ * ReservedResourceType.
+ :vartype dimensions: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ :ivar tags: Has comparison expression for a tag.
+
+ Supported for CategoryType(s): Cost.
+ :vartype tags: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ """
+
+ _attribute_map = {
+ "dimensions": {"key": "dimensions", "type": "BudgetComparisonExpression"},
+ "tags": {"key": "tags", "type": "BudgetComparisonExpression"},
+ }
+
+ def __init__(
+ self,
+ *,
+ dimensions: Optional["_models.BudgetComparisonExpression"] = None,
+ tags: Optional["_models.BudgetComparisonExpression"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword dimensions: Has comparison expression for a dimension.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported dimension names for **CategoryType: ReservationUtilization**
+
+
+ * ReservationId
+ * ReservedResourceType.
+ :paramtype dimensions: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ :keyword tags: Has comparison expression for a tag.
+
+ Supported for CategoryType(s): Cost.
+ :paramtype tags: ~azure.mgmt.costmanagement.models.BudgetComparisonExpression
+ """
+ super().__init__(**kwargs)
+ self.dimensions = dimensions
+ self.tags = tags
+
+
+class BudgetsListResult(_serialization.Model):
+ """Result of listing budgets. It contains a list of available budgets in the scope provided.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: The list of budgets.
+ :vartype value: list[~azure.mgmt.costmanagement.models.Budget]
+ :ivar next_link: The link (url) to the next page of results.
+ It's null for now, added for future use.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "value": {"readonly": True},
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[Budget]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class BudgetTimePeriod(_serialization.Model):
+ """The time period that defines the active period of the budget. The budget will evaluate data on
+ or after the startDate and will expire on the endDate.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Required for CategoryType(s): Cost, ReservationUtilization.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar start_date: The start date for the budget.
+
+
+ *
+ Constraints for **CategoryType: Cost** - Must be first of the month and should be less than
+ the end date. Budget start date must be on or after June 1, 2017. Future start date should not
+ be more than twelve months. Past start date should be selected within the timegrain period.
+
+ *
+ Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current
+ date and less than the end date. Required.
+ :vartype start_date: ~datetime.datetime
+ :ivar end_date: The end date for the budget.
+
+
+ *
+ Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to
+ 10 years from the start date.
+
+ *
+ Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3
+ years after the start date.
+ :vartype end_date: ~datetime.datetime
+ """
+
+ _validation = {
+ "start_date": {"required": True},
+ }
+
+ _attribute_map = {
+ "start_date": {"key": "startDate", "type": "iso-8601"},
+ "end_date": {"key": "endDate", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self, *, start_date: datetime.datetime, end_date: Optional[datetime.datetime] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword start_date: The start date for the budget.
+
+
+ *
+ Constraints for **CategoryType: Cost** - Must be first of the month and should be less than
+ the end date. Budget start date must be on or after June 1, 2017. Future start date should not
+ be more than twelve months. Past start date should be selected within the timegrain period.
+
+ *
+ Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current
+ date and less than the end date. Required.
+ :paramtype start_date: ~datetime.datetime
+ :keyword end_date: The end date for the budget.
+
+
+ *
+ Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to
+ 10 years from the start date.
+
+ *
+ Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3
+ years after the start date.
+ :paramtype end_date: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ self.start_date = start_date
+ self.end_date = end_date
+
+
+class CheckNameAvailabilityRequest(_serialization.Model):
+ """The check availability request body.
+
+ :ivar name: The name of the resource for which availability needs to be checked.
+ :vartype name: str
+ :ivar type: The resource type.
+ :vartype type: str
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword name: The name of the resource for which availability needs to be checked.
+ :paramtype name: str
+ :keyword type: The resource type.
+ :paramtype type: str
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.type = type
+
+
+class CheckNameAvailabilityResponse(_serialization.Model):
+ """The check availability result.
+
+ :ivar name_available: Indicates if the resource name is available.
+ :vartype name_available: bool
+ :ivar reason: The reason why the given name is not available. Known values are: "Invalid" and
+ "AlreadyExists".
+ :vartype reason: str or ~azure.mgmt.costmanagement.models.CheckNameAvailabilityReason
+ :ivar message: Detailed reason why the given name is available.
+ :vartype message: str
+ """
+
+ _attribute_map = {
+ "name_available": {"key": "nameAvailable", "type": "bool"},
+ "reason": {"key": "reason", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name_available: Optional[bool] = None,
+ reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None,
+ message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name_available: Indicates if the resource name is available.
+ :paramtype name_available: bool
+ :keyword reason: The reason why the given name is not available. Known values are: "Invalid"
+ and "AlreadyExists".
+ :paramtype reason: str or ~azure.mgmt.costmanagement.models.CheckNameAvailabilityReason
+ :keyword message: Detailed reason why the given name is available.
+ :paramtype message: str
+ """
+ super().__init__(**kwargs)
+ self.name_available = name_available
+ self.reason = reason
+ self.message = message
+
+
+class CommonExportProperties(_serialization.Model):
+ """The common properties of the export.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar format: The format of the export being delivered. Currently only 'Csv' is supported.
+ "Csv"
+ :vartype format: str or ~azure.mgmt.costmanagement.models.FormatType
+ :ivar delivery_info: Has delivery information for the export. Required.
+ :vartype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
+ :ivar definition: Has the definition for the export. Required.
+ :vartype definition: ~azure.mgmt.costmanagement.models.ExportDefinition
+ :ivar run_history: If requested, has the most recent run history for the export.
+ :vartype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
+ :ivar partition_data: If set to true, exported data will be partitioned by size and placed in a
+ blob directory together with a manifest file. Note: this option is currently available only for
+ Microsoft Customer Agreement commerce scopes.
+ :vartype partition_data: bool
+ :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
+ next run time.
+ :vartype next_run_time_estimate: ~datetime.datetime
+ """
+
+ _validation = {
+ "delivery_info": {"required": True},
+ "definition": {"required": True},
+ "next_run_time_estimate": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "format": {"key": "format", "type": "str"},
+ "delivery_info": {"key": "deliveryInfo", "type": "ExportDeliveryInfo"},
+ "definition": {"key": "definition", "type": "ExportDefinition"},
+ "run_history": {"key": "runHistory", "type": "ExportExecutionListResult"},
+ "partition_data": {"key": "partitionData", "type": "bool"},
+ "next_run_time_estimate": {"key": "nextRunTimeEstimate", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ delivery_info: "_models.ExportDeliveryInfo",
+ definition: "_models.ExportDefinition",
+ format: Optional[Union[str, "_models.FormatType"]] = None,
+ run_history: Optional["_models.ExportExecutionListResult"] = None,
+ partition_data: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword format: The format of the export being delivered. Currently only 'Csv' is supported.
+ "Csv"
+ :paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType
+ :keyword delivery_info: Has delivery information for the export. Required.
+ :paramtype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
+ :keyword definition: Has the definition for the export. Required.
+ :paramtype definition: ~azure.mgmt.costmanagement.models.ExportDefinition
+ :keyword run_history: If requested, has the most recent run history for the export.
+ :paramtype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
+ :keyword partition_data: If set to true, exported data will be partitioned by size and placed
+ in a blob directory together with a manifest file. Note: this option is currently available
+ only for Microsoft Customer Agreement commerce scopes.
+ :paramtype partition_data: bool
+ """
+ super().__init__(**kwargs)
+ self.format = format
+ self.delivery_info = delivery_info
+ self.definition = definition
+ self.run_history = run_history
+ self.partition_data = partition_data
+ self.next_run_time_estimate = None
+
+
+class CostAllocationProportion(_serialization.Model):
+ """Target resources and allocation.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar name: Target resource for cost allocation. Required.
+ :vartype name: str
+ :ivar percentage: Percentage of source cost to allocate to this resource. This value can be
+ specified to two decimal places and the total percentage of all resources in this rule must sum
+ to 100.00. Required.
+ :vartype percentage: float
+ """
+
+ _validation = {
+ "name": {"required": True},
+ "percentage": {"required": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "percentage": {"key": "percentage", "type": "float"},
+ }
+
+ def __init__(self, *, name: str, percentage: float, **kwargs: Any) -> None:
+ """
+ :keyword name: Target resource for cost allocation. Required.
+ :paramtype name: str
+ :keyword percentage: Percentage of source cost to allocate to this resource. This value can be
+ specified to two decimal places and the total percentage of all resources in this rule must sum
+ to 100.00. Required.
+ :paramtype percentage: float
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.percentage = percentage
+
+
+class CostAllocationResource(_serialization.Model):
+ """Common values for resources for cost allocation.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar resource_type: Type of resources contained in this cost allocation rule. Required. Known
+ values are: "Dimension" and "Tag".
+ :vartype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :ivar name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :vartype name: str
+ """
+
+ _validation = {
+ "resource_type": {"required": True},
+ "name": {"required": True},
+ }
+
+ _attribute_map = {
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ }
+
+ def __init__(
+ self, *, resource_type: Union[str, "_models.CostAllocationResourceType"], name: str, **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_type: Type of resources contained in this cost allocation rule. Required.
+ Known values are: "Dimension" and "Tag".
+ :paramtype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :keyword name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :paramtype name: str
+ """
+ super().__init__(**kwargs)
+ self.resource_type = resource_type
+ self.name = name
+
+
+class CostAllocationRuleCheckNameAvailabilityRequest(_serialization.Model):
+ """The cost allocation rule check name availability request.
+
+ :ivar name: Rule name.
+ :vartype name: str
+ :ivar type: Resource type. This is expected to be Microsoft.CostManagement/costAllocationRules.
+ :vartype type: str
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword name: Rule name.
+ :paramtype name: str
+ :keyword type: Resource type. This is expected to be
+ Microsoft.CostManagement/costAllocationRules.
+ :paramtype type: str
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.type = type
+
+
+class CostAllocationRuleCheckNameAvailabilityResponse(_serialization.Model):
+ """The cost allocation rule check name availability response.
+
+ :ivar name_available: Whether this rule name is available.
+ :vartype name_available: bool
+ :ivar reason: The reason this name is not available. Known values are: "Invalid",
+ "AlreadyExists", and "Valid".
+ :vartype reason: str or ~azure.mgmt.costmanagement.models.Reason
+ :ivar message: Error message if the name is not available.
+ :vartype message: str
+ """
+
+ _attribute_map = {
+ "name_available": {"key": "nameAvailable", "type": "bool"},
+ "reason": {"key": "reason", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name_available: Optional[bool] = None,
+ reason: Optional[Union[str, "_models.Reason"]] = None,
+ message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name_available: Whether this rule name is available.
+ :paramtype name_available: bool
+ :keyword reason: The reason this name is not available. Known values are: "Invalid",
+ "AlreadyExists", and "Valid".
+ :paramtype reason: str or ~azure.mgmt.costmanagement.models.Reason
+ :keyword message: Error message if the name is not available.
+ :paramtype message: str
+ """
+ super().__init__(**kwargs)
+ self.name_available = name_available
+ self.reason = reason
+ self.message = message
+
+
+class CostAllocationRuleDefinition(_serialization.Model):
+ """The cost allocation rule model definition.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Azure Resource Manager Id for the rule. This is a read ony value.
+ :vartype id: str
+ :ivar name: Name of the rule. This is a read only value.
+ :vartype name: str
+ :ivar type: Resource type of the rule. This is a read only value of
+ Microsoft.CostManagement/CostAllocationRule.
+ :vartype type: str
+ :ivar properties: Cost allocation rule properties.
+ :vartype properties: ~azure.mgmt.costmanagement.models.CostAllocationRuleProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "properties": {"key": "properties", "type": "CostAllocationRuleProperties"},
+ }
+
+ def __init__(self, *, properties: Optional["_models.CostAllocationRuleProperties"] = None, **kwargs: Any) -> None:
+ """
+ :keyword properties: Cost allocation rule properties.
+ :paramtype properties: ~azure.mgmt.costmanagement.models.CostAllocationRuleProperties
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.properties = properties
+
+
+class CostAllocationRuleDetails(_serialization.Model):
+ """Resource details of the cost allocation rule.
+
+ :ivar source_resources: Source resources for cost allocation. At this time, this list can
+ contain no more than one element.
+ :vartype source_resources: list[~azure.mgmt.costmanagement.models.SourceCostAllocationResource]
+ :ivar target_resources: Target resources for cost allocation. At this time, this list can
+ contain no more than one element.
+ :vartype target_resources: list[~azure.mgmt.costmanagement.models.TargetCostAllocationResource]
+ """
+
+ _attribute_map = {
+ "source_resources": {"key": "sourceResources", "type": "[SourceCostAllocationResource]"},
+ "target_resources": {"key": "targetResources", "type": "[TargetCostAllocationResource]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ source_resources: Optional[List["_models.SourceCostAllocationResource"]] = None,
+ target_resources: Optional[List["_models.TargetCostAllocationResource"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword source_resources: Source resources for cost allocation. At this time, this list can
+ contain no more than one element.
+ :paramtype source_resources:
+ list[~azure.mgmt.costmanagement.models.SourceCostAllocationResource]
+ :keyword target_resources: Target resources for cost allocation. At this time, this list can
+ contain no more than one element.
+ :paramtype target_resources:
+ list[~azure.mgmt.costmanagement.models.TargetCostAllocationResource]
+ """
+ super().__init__(**kwargs)
+ self.source_resources = source_resources
+ self.target_resources = target_resources
+
+
+class CostAllocationRuleList(_serialization.Model):
+ """Result of listing cost allocation rules. It contains a list of available rules in the billing
+ account or enterprise enrollment provided.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: The list of cost allocation rules.
+ :vartype value: list[~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition]
+ :ivar next_link: URL to get the next set of rule list results if there are any.
+ :vartype next_link: str
"""
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
_attribute_map = {
- "name_available": {"key": "nameAvailable", "type": "bool"},
- "reason": {"key": "reason", "type": "str"},
- "message": {"key": "message", "type": "str"},
+ "value": {"key": "value", "type": "[CostAllocationRuleDefinition]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(
- self,
- *,
- name_available: Optional[bool] = None,
- reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None,
- message: Optional[str] = None,
- **kwargs: Any
- ) -> None:
+ def __init__(self, *, value: Optional[List["_models.CostAllocationRuleDefinition"]] = None, **kwargs: Any) -> None:
"""
- :keyword name_available: Indicates if the resource name is available.
- :paramtype name_available: bool
- :keyword reason: The reason why the given name is not available. Known values are: "Invalid"
- and "AlreadyExists".
- :paramtype reason: str or ~azure.mgmt.costmanagement.models.CheckNameAvailabilityReason
- :keyword message: Detailed reason why the given name is available.
- :paramtype message: str
+ :keyword value: The list of cost allocation rules.
+ :paramtype value: list[~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition]
"""
super().__init__(**kwargs)
- self.name_available = name_available
- self.reason = reason
- self.message = message
+ self.value = value
+ self.next_link = None
-class CommonExportProperties(_serialization.Model):
- """The common properties of the export.
+class CostAllocationRuleProperties(_serialization.Model):
+ """The properties of a cost allocation rule.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
- :ivar format: The format of the export being delivered. Currently only 'Csv' is supported.
- "Csv"
- :vartype format: str or ~azure.mgmt.costmanagement.models.FormatType
- :ivar delivery_info: Has delivery information for the export. Required.
- :vartype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
- :ivar definition: Has the definition for the export. Required.
- :vartype definition: ~azure.mgmt.costmanagement.models.ExportDefinition
- :ivar run_history: If requested, has the most recent run history for the export.
- :vartype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
- :ivar partition_data: If set to true, exported data will be partitioned by size and placed in a
- blob directory together with a manifest file. Note: this option is currently available only for
- Microsoft Customer Agreement commerce scopes.
- :vartype partition_data: bool
- :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
- next run time.
- :vartype next_run_time_estimate: ~datetime.datetime
+ :ivar description: Description of a cost allocation rule.
+ :vartype description: str
+ :ivar details: Resource information for the cost allocation rule. Required.
+ :vartype details: ~azure.mgmt.costmanagement.models.CostAllocationRuleDetails
+ :ivar status: Status of the rule. Required. Known values are: "NotActive", "Active", and
+ "Processing".
+ :vartype status: str or ~azure.mgmt.costmanagement.models.RuleStatus
+ :ivar created_date: Time at which the rule was created. Rules that change cost for the same
+ resource are applied in order of creation.
+ :vartype created_date: ~datetime.datetime
+ :ivar updated_date: Time at which the rule was last updated.
+ :vartype updated_date: ~datetime.datetime
"""
_validation = {
- "delivery_info": {"required": True},
- "definition": {"required": True},
- "next_run_time_estimate": {"readonly": True},
+ "details": {"required": True},
+ "status": {"required": True},
+ "created_date": {"readonly": True},
+ "updated_date": {"readonly": True},
}
_attribute_map = {
- "format": {"key": "format", "type": "str"},
- "delivery_info": {"key": "deliveryInfo", "type": "ExportDeliveryInfo"},
- "definition": {"key": "definition", "type": "ExportDefinition"},
- "run_history": {"key": "runHistory", "type": "ExportExecutionListResult"},
- "partition_data": {"key": "partitionData", "type": "bool"},
- "next_run_time_estimate": {"key": "nextRunTimeEstimate", "type": "iso-8601"},
+ "description": {"key": "description", "type": "str"},
+ "details": {"key": "details", "type": "CostAllocationRuleDetails"},
+ "status": {"key": "status", "type": "str"},
+ "created_date": {"key": "createdDate", "type": "iso-8601"},
+ "updated_date": {"key": "updatedDate", "type": "iso-8601"},
}
def __init__(
self,
*,
- delivery_info: "_models.ExportDeliveryInfo",
- definition: "_models.ExportDefinition",
- format: Optional[Union[str, "_models.FormatType"]] = None,
- run_history: Optional["_models.ExportExecutionListResult"] = None,
- partition_data: Optional[bool] = None,
+ details: "_models.CostAllocationRuleDetails",
+ status: Union[str, "_models.RuleStatus"],
+ description: Optional[str] = None,
**kwargs: Any
) -> None:
"""
- :keyword format: The format of the export being delivered. Currently only 'Csv' is supported.
- "Csv"
- :paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType
- :keyword delivery_info: Has delivery information for the export. Required.
- :paramtype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
- :keyword definition: Has the definition for the export. Required.
- :paramtype definition: ~azure.mgmt.costmanagement.models.ExportDefinition
- :keyword run_history: If requested, has the most recent run history for the export.
- :paramtype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
- :keyword partition_data: If set to true, exported data will be partitioned by size and placed
- in a blob directory together with a manifest file. Note: this option is currently available
- only for Microsoft Customer Agreement commerce scopes.
- :paramtype partition_data: bool
+ :keyword description: Description of a cost allocation rule.
+ :paramtype description: str
+ :keyword details: Resource information for the cost allocation rule. Required.
+ :paramtype details: ~azure.mgmt.costmanagement.models.CostAllocationRuleDetails
+ :keyword status: Status of the rule. Required. Known values are: "NotActive", "Active", and
+ "Processing".
+ :paramtype status: str or ~azure.mgmt.costmanagement.models.RuleStatus
"""
super().__init__(**kwargs)
- self.format = format
- self.delivery_info = delivery_info
- self.definition = definition
- self.run_history = run_history
- self.partition_data = partition_data
- self.next_run_time_estimate = None
+ self.description = description
+ self.details = details
+ self.status = status
+ self.created_date = None
+ self.updated_date = None
class CostDetailsOperationResults(_serialization.Model): # pylint: disable=too-many-instance-attributes
@@ -1425,6 +2412,36 @@ def __init__(self, **kwargs: Any) -> None:
self.tags = None
+class CurrentSpend(_serialization.Model):
+ """The current amount of cost which is being tracked for a budget.
+
+ Supported for CategoryType(s): Cost.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar amount: The total amount of cost which is being tracked by the budget.
+ :vartype amount: float
+ :ivar unit: The unit of measure for the budget amount.
+ :vartype unit: str
+ """
+
+ _validation = {
+ "amount": {"readonly": True},
+ "unit": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "amount": {"key": "amount", "type": "float"},
+ "unit": {"key": "unit", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.amount = None
+ self.unit = None
+
+
class Dimension(CostManagementResource): # pylint: disable=too-many-instance-attributes
"""List of Dimension.
@@ -1679,6 +2696,77 @@ def __init__(
self.download_url = download_url
+class ErrorAdditionalInfo(_serialization.Model):
+ """The resource management error additional info.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar type: The additional info type.
+ :vartype type: str
+ :ivar info: The additional info.
+ :vartype info: JSON
+ """
+
+ _validation = {
+ "type": {"readonly": True},
+ "info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "info": {"key": "info", "type": "object"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.type = None
+ self.info = None
+
+
+class ErrorDetail(_serialization.Model):
+ """The error detail.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar details: The error details.
+ :vartype details: list[~azure.mgmt.costmanagement.models.ErrorDetail]
+ :ivar additional_info: The error additional info.
+ :vartype additional_info: list[~azure.mgmt.costmanagement.models.ErrorAdditionalInfo]
+ """
+
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "target": {"readonly": True},
+ "details": {"readonly": True},
+ "additional_info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "details": {"key": "details", "type": "[ErrorDetail]"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.target = None
+ self.details = None
+ self.additional_info = None
+
+
class ErrorDetails(_serialization.Model):
"""The details of the error.
@@ -1770,6 +2858,27 @@ def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs:
self.error = error
+class ErrorResponseAutoGenerated(_serialization.Model):
+ """Common error response for all Azure Resource Manager APIs to return error details for failed
+ operations. (This also follows the OData error response format.).
+
+ :ivar error: The error object.
+ :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetail
+ """
+
+ _attribute_map = {
+ "error": {"key": "error", "type": "ErrorDetail"},
+ }
+
+ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None:
+ """
+ :keyword error: The error object.
+ :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetail
+ """
+ super().__init__(**kwargs)
+ self.error = error
+
+
class ErrorResponseWithNestedDetails(_serialization.Model):
"""Error response indicates that the service is not able to process the incoming request. The
reason is provided in the error message.
@@ -1816,6 +2925,11 @@ class Export(CostManagementProxyResource): # pylint: disable=too-many-instance-
:ivar e_tag: 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.
:vartype e_tag: str
+ :ivar identity: The managed identity associated with Export.
+ :vartype identity: ~azure.mgmt.costmanagement.models.SystemAssignedServiceIdentity
+ :ivar location: The location of the Export's managed identity. Only required when utilizing
+ managed identity.
+ :vartype location: str
:ivar format: The format of the export being delivered. Currently only 'Csv' is supported.
"Csv"
:vartype format: str or ~azure.mgmt.costmanagement.models.FormatType
@@ -1848,6 +2962,8 @@ class Export(CostManagementProxyResource): # pylint: disable=too-many-instance-
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"e_tag": {"key": "eTag", "type": "str"},
+ "identity": {"key": "identity", "type": "SystemAssignedServiceIdentity"},
+ "location": {"key": "location", "type": "str"},
"format": {"key": "properties.format", "type": "str"},
"delivery_info": {"key": "properties.deliveryInfo", "type": "ExportDeliveryInfo"},
"definition": {"key": "properties.definition", "type": "ExportDefinition"},
@@ -1861,6 +2977,8 @@ def __init__(
self,
*,
e_tag: Optional[str] = None,
+ identity: Optional["_models.SystemAssignedServiceIdentity"] = None,
+ location: Optional[str] = None,
format: Optional[Union[str, "_models.FormatType"]] = None,
delivery_info: Optional["_models.ExportDeliveryInfo"] = None,
definition: Optional["_models.ExportDefinition"] = None,
@@ -1873,6 +2991,11 @@ def __init__(
:keyword e_tag: 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.
:paramtype e_tag: str
+ :keyword identity: The managed identity associated with Export.
+ :paramtype identity: ~azure.mgmt.costmanagement.models.SystemAssignedServiceIdentity
+ :keyword location: The location of the Export's managed identity. Only required when utilizing
+ managed identity.
+ :paramtype location: str
:keyword format: The format of the export being delivered. Currently only 'Csv' is supported.
"Csv"
:paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType
@@ -1890,6 +3013,8 @@ def __init__(
:paramtype schedule: ~azure.mgmt.costmanagement.models.ExportSchedule
"""
super().__init__(e_tag=e_tag, **kwargs)
+ self.identity = identity
+ self.location = location
self.format = format
self.delivery_info = delivery_info
self.definition = definition
@@ -2887,6 +4012,37 @@ def __init__(
self.rows = rows
+class ForecastSpend(_serialization.Model):
+ """The forecasted cost which is being tracked for a budget.
+
+ Supported for CategoryType(s): Cost.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar amount: The forecasted cost for the total time period which is being tracked by the
+ budget. This value is only provided if the budget contains a forecast alert type.
+ :vartype amount: float
+ :ivar unit: The unit of measure for the budget amount.
+ :vartype unit: str
+ """
+
+ _validation = {
+ "amount": {"readonly": True},
+ "unit": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "amount": {"key": "amount", "type": "float"},
+ "unit": {"key": "unit", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.amount = None
+ self.unit = None
+
+
class ForecastTimePeriod(_serialization.Model):
"""Has time period for pulling data for the forecast.
@@ -3454,53 +4610,242 @@ class IncludedQuantityUtilizationSummaryProperties(BenefitUtilizationSummaryProp
"utilization_percentage": {"key": "utilizationPercentage", "type": "float"},
}
- def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None:
- """
- :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are:
- "IncludedQuantity", "Reservation", and "SavingsPlan".
- :paramtype benefit_type: str or ~azure.mgmt.costmanagement.models.BenefitKind
- """
- super().__init__(benefit_type=benefit_type, **kwargs)
- self.utilization_percentage = None
+ def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are:
+ "IncludedQuantity", "Reservation", and "SavingsPlan".
+ :paramtype benefit_type: str or ~azure.mgmt.costmanagement.models.BenefitKind
+ """
+ super().__init__(benefit_type=benefit_type, **kwargs)
+ self.utilization_percentage = None
+
+
+class KpiProperties(_serialization.Model):
+ """Each KPI must contain a 'type' and 'enabled' key.
+
+ :ivar type: KPI type (Forecast, Budget). Known values are: "Forecast" and "Budget".
+ :vartype type: str or ~azure.mgmt.costmanagement.models.KpiType
+ :ivar id: ID of resource related to metric (budget).
+ :vartype id: str
+ :ivar enabled: show the KPI in the UI?.
+ :vartype enabled: bool
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "id": {"key": "id", "type": "str"},
+ "enabled": {"key": "enabled", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.KpiType"]] = None,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ enabled: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: KPI type (Forecast, Budget). Known values are: "Forecast" and "Budget".
+ :paramtype type: str or ~azure.mgmt.costmanagement.models.KpiType
+ :keyword id: ID of resource related to metric (budget).
+ :paramtype id: str
+ :keyword enabled: show the KPI in the UI?.
+ :paramtype enabled: bool
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.id = id
+ self.enabled = enabled
+
+
+class Notification(_serialization.Model):
+ """The notification associated with a budget.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar enabled: The notification is enabled or not.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization. Required.
+ :vartype enabled: bool
+ :ivar operator: The comparison operator.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported operators for **CategoryType: Cost**
+
+
+ * GreaterThan
+ *
+ GreaterThanOrEqualTo
+
+ Supported operators for **CategoryType: ReservationUtilization**
+
+ * LessThan. Required. Known values are: "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", and
+ "LessThan".
+ :vartype operator: str or ~azure.mgmt.costmanagement.models.BudgetNotificationOperatorType
+ :ivar threshold: Threshold value associated with a notification. It is always percent with a
+ maximum of 2 decimal places.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost
+ exceeded the threshold.
+
+ **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent
+ when a reservation has a utilization percentage below the threshold. Required.
+ :vartype threshold: float
+ :ivar frequency: Frequency of a notification. Represents how long the notification will be
+ silent after triggering an alert for a threshold breach. If not specified, the frequency will
+ be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when
+ timeGrain: Last30Days).
+
+ Supported for CategoryType(s): ReservationUtilization. Known values are: "Daily", "Weekly",
+ and "Monthly".
+ :vartype frequency: str or ~azure.mgmt.costmanagement.models.Frequency
+ :ivar contact_emails: Email addresses to send the notification to when the threshold is
+ breached. Must have at least one contact email or contact group specified at the Subscription
+ or Resource Group scopes. All other scopes must have at least one contact email specified.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization. Required.
+ :vartype contact_emails: list[str]
+ :ivar contact_roles: Subscription or Resource Group scopes only. Contact roles to send the
+ notification to when the threshold is breached.
+
+ Supported for CategoryType(s): Cost.
+ :vartype contact_roles: list[str]
+ :ivar contact_groups: Subscription or Resource Group scopes only. Action groups to send the
+ notification to when the threshold is exceeded. Must be provided as a fully qualified Azure
+ resource id.
+ Supported for CategoryType(s): Cost.
+ :vartype contact_groups: list[str]
+ :ivar threshold_type: The type of threshold.
-class KpiProperties(_serialization.Model):
- """Each KPI must contain a 'type' and 'enabled' key.
+ Supported for CategoryType(s): Cost. Known values are: "Actual" and "Forecasted".
+ :vartype threshold_type: str or ~azure.mgmt.costmanagement.models.ThresholdType
+ :ivar locale: Language in which the recipient will receive the notification,
- :ivar type: KPI type (Forecast, Budget). Known values are: "Forecast" and "Budget".
- :vartype type: str or ~azure.mgmt.costmanagement.models.KpiType
- :ivar id: ID of resource related to metric (budget).
- :vartype id: str
- :ivar enabled: show the KPI in the UI?.
- :vartype enabled: bool
+ Supported for CategoryType(s): Cost, ReservationUtilization. Known values are: "en-us",
+ "ja-jp", "zh-cn", "de-de", "es-es", "fr-fr", "it-it", "ko-kr", "pt-br", "ru-ru", "zh-tw",
+ "cs-cz", "pl-pl", "tr-tr", "da-dk", "en-gb", "hu-hu", "nb-no", "nl-nl", "pt-pt", and "sv-se".
+ :vartype locale: str or ~azure.mgmt.costmanagement.models.CultureCode
"""
+ _validation = {
+ "enabled": {"required": True},
+ "operator": {"required": True},
+ "threshold": {"required": True},
+ "contact_emails": {"required": True, "max_items": 50, "min_items": 0},
+ "contact_groups": {"max_items": 50, "min_items": 0},
+ }
+
_attribute_map = {
- "type": {"key": "type", "type": "str"},
- "id": {"key": "id", "type": "str"},
"enabled": {"key": "enabled", "type": "bool"},
+ "operator": {"key": "operator", "type": "str"},
+ "threshold": {"key": "threshold", "type": "float"},
+ "frequency": {"key": "frequency", "type": "str"},
+ "contact_emails": {"key": "contactEmails", "type": "[str]"},
+ "contact_roles": {"key": "contactRoles", "type": "[str]"},
+ "contact_groups": {"key": "contactGroups", "type": "[str]"},
+ "threshold_type": {"key": "thresholdType", "type": "str"},
+ "locale": {"key": "locale", "type": "str"},
}
def __init__(
self,
*,
- type: Optional[Union[str, "_models.KpiType"]] = None,
- id: Optional[str] = None, # pylint: disable=redefined-builtin
- enabled: Optional[bool] = None,
+ enabled: bool,
+ operator: Union[str, "_models.BudgetNotificationOperatorType"],
+ threshold: float,
+ contact_emails: List[str],
+ frequency: Optional[Union[str, "_models.Frequency"]] = None,
+ contact_roles: Optional[List[str]] = None,
+ contact_groups: Optional[List[str]] = None,
+ threshold_type: Union[str, "_models.ThresholdType"] = "Actual",
+ locale: Optional[Union[str, "_models.CultureCode"]] = None,
**kwargs: Any
) -> None:
"""
- :keyword type: KPI type (Forecast, Budget). Known values are: "Forecast" and "Budget".
- :paramtype type: str or ~azure.mgmt.costmanagement.models.KpiType
- :keyword id: ID of resource related to metric (budget).
- :paramtype id: str
- :keyword enabled: show the KPI in the UI?.
+ :keyword enabled: The notification is enabled or not.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization. Required.
:paramtype enabled: bool
+ :keyword operator: The comparison operator.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ Supported operators for **CategoryType: Cost**
+
+
+ * GreaterThan
+ *
+ GreaterThanOrEqualTo
+
+ Supported operators for **CategoryType: ReservationUtilization**
+
+ * LessThan. Required. Known values are: "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", and
+ "LessThan".
+ :paramtype operator: str or ~azure.mgmt.costmanagement.models.BudgetNotificationOperatorType
+ :keyword threshold: Threshold value associated with a notification. It is always percent with a
+ maximum of 2 decimal places.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization.
+
+ **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost
+ exceeded the threshold.
+
+ **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent
+ when a reservation has a utilization percentage below the threshold. Required.
+ :paramtype threshold: float
+ :keyword frequency: Frequency of a notification. Represents how long the notification will be
+ silent after triggering an alert for a threshold breach. If not specified, the frequency will
+ be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when
+ timeGrain: Last30Days).
+
+ Supported for CategoryType(s): ReservationUtilization. Known values are: "Daily", "Weekly",
+ and "Monthly".
+ :paramtype frequency: str or ~azure.mgmt.costmanagement.models.Frequency
+ :keyword contact_emails: Email addresses to send the notification to when the threshold is
+ breached. Must have at least one contact email or contact group specified at the Subscription
+ or Resource Group scopes. All other scopes must have at least one contact email specified.
+
+ Supported for CategoryType(s): Cost, ReservationUtilization. Required.
+ :paramtype contact_emails: list[str]
+ :keyword contact_roles: Subscription or Resource Group scopes only. Contact roles to send the
+ notification to when the threshold is breached.
+
+ Supported for CategoryType(s): Cost.
+ :paramtype contact_roles: list[str]
+ :keyword contact_groups: Subscription or Resource Group scopes only. Action groups to send the
+ notification to when the threshold is exceeded. Must be provided as a fully qualified Azure
+ resource id.
+
+ Supported for CategoryType(s): Cost.
+ :paramtype contact_groups: list[str]
+ :keyword threshold_type: The type of threshold.
+
+ Supported for CategoryType(s): Cost. Known values are: "Actual" and "Forecasted".
+ :paramtype threshold_type: str or ~azure.mgmt.costmanagement.models.ThresholdType
+ :keyword locale: Language in which the recipient will receive the notification,
+
+ Supported for CategoryType(s): Cost, ReservationUtilization. Known values are: "en-us",
+ "ja-jp", "zh-cn", "de-de", "es-es", "fr-fr", "it-it", "ko-kr", "pt-br", "ru-ru", "zh-tw",
+ "cs-cz", "pl-pl", "tr-tr", "da-dk", "en-gb", "hu-hu", "nb-no", "nl-nl", "pt-pt", and "sv-se".
+ :paramtype locale: str or ~azure.mgmt.costmanagement.models.CultureCode
"""
super().__init__(**kwargs)
- self.type = type
- self.id = id
self.enabled = enabled
+ self.operator = operator
+ self.threshold = threshold
+ self.frequency = frequency
+ self.contact_emails = contact_emails
+ self.contact_roles = contact_roles
+ self.contact_groups = contact_groups
+ self.threshold_type = threshold_type
+ self.locale = locale
class NotificationProperties(_serialization.Model):
@@ -3642,7 +4987,7 @@ class OperationStatus(_serialization.Model):
"""The status of the long running operation.
:ivar status: The status of the long running operation. Known values are: "Running",
- "Completed", and "Failed".
+ "Complete", "Failed", and "Completed".
:vartype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType
:ivar report_url: The CSV file from the reportUrl blob link consists of reservation usage data
with the following schema at daily granularity. Known values are: "InstanceFlexibilityGroup",
@@ -3669,7 +5014,7 @@ def __init__(
) -> None:
"""
:keyword status: The status of the long running operation. Known values are: "Running",
- "Completed", and "Failed".
+ "Complete", "Failed", and "Completed".
:paramtype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType
:keyword report_url: The CSV file from the reportUrl blob link consists of reservation usage
data with the following schema at daily granularity. Known values are:
@@ -4583,14 +5928,14 @@ class SavingsPlanUtilizationSummary(BenefitUtilizationSummary): # pylint: disab
:vartype usage_date: ~datetime.datetime
:ivar avg_utilization_percentage: This is the average hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the avgUtilizationPercentage value will be equal to
the average of the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day.
:vartype avg_utilization_percentage: float
:ivar min_utilization_percentage: This is the minimum hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the minUtilizationPercentage value will be equal to
the smallest in the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day. If on the day 2022-10-18, the lowest utilization percentage
@@ -4598,7 +5943,7 @@ class SavingsPlanUtilizationSummary(BenefitUtilizationSummary): # pylint: disab
:vartype min_utilization_percentage: float
:ivar max_utilization_percentage: This is the maximum hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the maxUtilizationPercentage value will be equal to
the largest in the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day. If on the day 2022-10-18, the largest utilization percentage
@@ -4672,14 +6017,14 @@ class SavingsPlanUtilizationSummaryProperties(BenefitUtilizationSummaryPropertie
:vartype usage_date: ~datetime.datetime
:ivar avg_utilization_percentage: This is the average hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the avgUtilizationPercentage value will be equal to
the average of the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day.
:vartype avg_utilization_percentage: float
:ivar min_utilization_percentage: This is the minimum hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the minUtilizationPercentage value will be equal to
the smallest in the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day. If on the day 2022-10-18, the lowest utilization percentage
@@ -4687,7 +6032,7 @@ class SavingsPlanUtilizationSummaryProperties(BenefitUtilizationSummaryPropertie
:vartype min_utilization_percentage: float
:ivar max_utilization_percentage: This is the maximum hourly utilization for each date range
that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate >
- 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
+ 2023-08-01 and usageDate < 2022-10-31 at a daily granularity. There will be one record per
benefit id for each day. For a single day, the maxUtilizationPercentage value will be equal to
the largest in the set of values where the set contains 24 utilization percentage entries one
for each hour in a specific day. If on the day 2022-10-18, the largest utilization percentage
@@ -4813,10 +6158,11 @@ class ScheduledAction(ScheduledActionProxyResource): # pylint: disable=too-many
:vartype notification_email: str
:ivar schedule: Schedule of the scheduled action.
:vartype schedule: ~azure.mgmt.costmanagement.models.ScheduleProperties
- :ivar scope: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription
- scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup
- scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account
- scope,
+ :ivar scope: For private scheduled action(Create or Update), scope will be empty.:code:`
`
+ For shared scheduled action(Create or Update By Scope), Cost Management scope can be
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
@@ -4891,10 +6237,11 @@ def __init__(
:paramtype notification_email: str
:keyword schedule: Schedule of the scheduled action.
:paramtype schedule: ~azure.mgmt.costmanagement.models.ScheduleProperties
- :keyword scope: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription
- scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup
- scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account
- scope,
+ :keyword scope: For private scheduled action(Create or Update), scope will be empty.:code:`
` For shared scheduled action(Create or Update By Scope), Cost Management scope can be
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
@@ -5039,6 +6386,73 @@ def __init__(
self.end_date = end_date
+class Setting(ProxyResource):
+ """Setting definition.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ TagInheritanceSetting
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar id: Fully qualified resource ID for the resource. Ex -
+ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar kind: Specifies the kind of settings. Required. "taginheritance"
+ :vartype kind: str or ~azure.mgmt.costmanagement.models.SettingsKind
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "kind": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ }
+
+ _subtype_map = {"kind": {"taginheritance": "TagInheritanceSetting"}}
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
+
+
+class SettingsListResult(_serialization.Model):
+ """Setting list result. It contains a list of settings.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: The list of settings.
+ :vartype value: list[~azure.mgmt.costmanagement.models.Setting]
+ """
+
+ _validation = {
+ "value": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[Setting]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.value = None
+
+
class SharedScopeBenefitRecommendationProperties(
BenefitRecommendationProperties
): # pylint: disable=too-many-instance-attributes
@@ -5273,6 +6687,57 @@ def __init__(
self.resource_group = None
+class SourceCostAllocationResource(CostAllocationResource):
+ """Source resources for cost allocation.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar resource_type: Type of resources contained in this cost allocation rule. Required. Known
+ values are: "Dimension" and "Tag".
+ :vartype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :ivar name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :vartype name: str
+ :ivar values: Source Resources for cost allocation. This list cannot contain more than 25
+ values. Required.
+ :vartype values: list[str]
+ """
+
+ _validation = {
+ "resource_type": {"required": True},
+ "name": {"required": True},
+ "values": {"required": True},
+ }
+
+ _attribute_map = {
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "values": {"key": "values", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_type: Union[str, "_models.CostAllocationResourceType"],
+ name: str,
+ values: List[str],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_type: Type of resources contained in this cost allocation rule. Required.
+ Known values are: "Dimension" and "Tag".
+ :paramtype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :keyword name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :paramtype name: str
+ :keyword values: Source Resources for cost allocation. This list cannot contain more than 25
+ values. Required.
+ :paramtype values: list[str]
+ """
+ super().__init__(resource_type=resource_type, name=name, **kwargs)
+ self.values = values
+
+
class Status(_serialization.Model):
"""The status of the long running operation.
@@ -5297,6 +6762,48 @@ def __init__(
self.status = status
+class SystemAssignedServiceIdentity(_serialization.Model):
+ """Managed service identity (either system assigned, or none).
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar principal_id: The service principal ID of the system assigned identity. This property
+ will only be provided for a system assigned identity.
+ :vartype principal_id: str
+ :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be
+ provided for a system assigned identity.
+ :vartype tenant_id: str
+ :ivar type: Type of managed service identity (either system assigned, or none). Required. Known
+ values are: "None" and "SystemAssigned".
+ :vartype type: str or ~azure.mgmt.costmanagement.models.SystemAssignedServiceIdentityType
+ """
+
+ _validation = {
+ "principal_id": {"readonly": True},
+ "tenant_id": {"readonly": True},
+ "type": {"required": True},
+ }
+
+ _attribute_map = {
+ "principal_id": {"key": "principalId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(self, *, type: Union[str, "_models.SystemAssignedServiceIdentityType"], **kwargs: Any) -> None:
+ """
+ :keyword type: Type of managed service identity (either system assigned, or none). Required.
+ Known values are: "None" and "SystemAssigned".
+ :paramtype type: str or ~azure.mgmt.costmanagement.models.SystemAssignedServiceIdentityType
+ """
+ super().__init__(**kwargs)
+ self.principal_id = None
+ self.tenant_id = None
+ self.type = type
+
+
class SystemData(_serialization.Model):
"""Metadata pertaining to creation and last modification of the resource.
@@ -5361,6 +6868,143 @@ def __init__(
self.last_modified_at = last_modified_at
+class TagInheritanceProperties(_serialization.Model):
+ """The properties of the tag inheritance setting.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar prefer_container_tags: When resource has the same tag as subscription or resource group
+ and this property is set to true - the subscription or resource group tag will be applied. If
+ subscription and resource group tags are also the same, subscription tag will be applied.
+ Required.
+ :vartype prefer_container_tags: bool
+ """
+
+ _validation = {
+ "prefer_container_tags": {"required": True},
+ }
+
+ _attribute_map = {
+ "prefer_container_tags": {"key": "preferContainerTags", "type": "bool"},
+ }
+
+ def __init__(self, *, prefer_container_tags: bool, **kwargs: Any) -> None:
+ """
+ :keyword prefer_container_tags: When resource has the same tag as subscription or resource
+ group and this property is set to true - the subscription or resource group tag will be
+ applied. If subscription and resource group tags are also the same, subscription tag will be
+ applied. Required.
+ :paramtype prefer_container_tags: bool
+ """
+ super().__init__(**kwargs)
+ self.prefer_container_tags = prefer_container_tags
+
+
+class TagInheritanceSetting(Setting):
+ """Tag Inheritance Setting definition.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar id: Fully qualified resource ID for the resource. Ex -
+ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar kind: Specifies the kind of settings. Required. "taginheritance"
+ :vartype kind: str or ~azure.mgmt.costmanagement.models.SettingsKind
+ :ivar properties: The properties of the tag inheritance setting.
+ :vartype properties: ~azure.mgmt.costmanagement.models.TagInheritanceProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "kind": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "properties": {"key": "properties", "type": "TagInheritanceProperties"},
+ }
+
+ def __init__(self, *, properties: Optional["_models.TagInheritanceProperties"] = None, **kwargs: Any) -> None:
+ """
+ :keyword properties: The properties of the tag inheritance setting.
+ :paramtype properties: ~azure.mgmt.costmanagement.models.TagInheritanceProperties
+ """
+ super().__init__(**kwargs)
+ self.kind: str = "taginheritance"
+ self.properties = properties
+
+
+class TargetCostAllocationResource(CostAllocationResource):
+ """Target resources for cost allocation.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :ivar resource_type: Type of resources contained in this cost allocation rule. Required. Known
+ values are: "Dimension" and "Tag".
+ :vartype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :ivar name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :vartype name: str
+ :ivar values: Target resources for cost allocation. This list cannot contain more than 25
+ values. Required.
+ :vartype values: list[~azure.mgmt.costmanagement.models.CostAllocationProportion]
+ :ivar policy_type: Method of cost allocation for the rule. Required. "FixedProportion"
+ :vartype policy_type: str or ~azure.mgmt.costmanagement.models.CostAllocationPolicyType
+ """
+
+ _validation = {
+ "resource_type": {"required": True},
+ "name": {"required": True},
+ "values": {"required": True},
+ "policy_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "values": {"key": "values", "type": "[CostAllocationProportion]"},
+ "policy_type": {"key": "policyType", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_type: Union[str, "_models.CostAllocationResourceType"],
+ name: str,
+ values: List["_models.CostAllocationProportion"],
+ policy_type: Union[str, "_models.CostAllocationPolicyType"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_type: Type of resources contained in this cost allocation rule. Required.
+ Known values are: "Dimension" and "Tag".
+ :paramtype resource_type: str or ~azure.mgmt.costmanagement.models.CostAllocationResourceType
+ :keyword name: If resource type is dimension, this must be either ResourceGroupName or
+ SubscriptionId. If resource type is tag, this must be a valid Azure tag. Required.
+ :paramtype name: str
+ :keyword values: Target resources for cost allocation. This list cannot contain more than 25
+ values. Required.
+ :paramtype values: list[~azure.mgmt.costmanagement.models.CostAllocationProportion]
+ :keyword policy_type: Method of cost allocation for the rule. Required. "FixedProportion"
+ :paramtype policy_type: str or ~azure.mgmt.costmanagement.models.CostAllocationPolicyType
+ """
+ super().__init__(resource_type=resource_type, name=name, **kwargs)
+ self.values = values
+ self.policy_type = policy_type
+
+
class View(CostManagementProxyResource): # pylint: disable=too-many-instance-attributes
"""States and configurations of Cost Analysis.
@@ -5436,7 +7080,6 @@ class View(CostManagementProxyResource): # pylint: disable=too-many-instance-at
"name": {"readonly": True},
"type": {"readonly": True},
"created_on": {"readonly": True},
- "modified_on": {"readonly": True},
"currency": {"readonly": True},
}
@@ -5469,6 +7112,7 @@ def __init__(
e_tag: Optional[str] = None,
display_name: Optional[str] = None,
scope: Optional[str] = None,
+ modified_on: Optional[datetime.datetime] = None,
date_range: Optional[str] = None,
chart: Optional[Union[str, "_models.ChartType"]] = None,
accumulated: Optional[Union[str, "_models.AccumulatedType"]] = None,
@@ -5506,6 +7150,8 @@ def __init__(
'/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
ExternalSubscription scope.
:paramtype scope: str
+ :keyword modified_on: Date when the user last modified this view.
+ :paramtype modified_on: ~datetime.datetime
:keyword date_range: Date range of the current view.
:paramtype date_range: str
:keyword chart: Chart type of the main view in Cost Analysis. Required. Known values are:
@@ -5539,7 +7185,7 @@ def __init__(
self.display_name = display_name
self.scope = scope
self.created_on = None
- self.modified_on = None
+ self.modified_on = modified_on
self.date_range = date_range
self.currency = None
self.chart = chart
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py
index ba3f6355c103..1c86bbc36a0d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py
@@ -7,12 +7,12 @@
# --------------------------------------------------------------------------
from ._operations import Operations
-from ._views_operations import ViewsOperations
-from ._alerts_operations import AlertsOperations
-from ._forecast_operations import ForecastOperations
-from ._dimensions_operations import DimensionsOperations
-from ._query_operations import QueryOperations
-from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations
+from ._benefit_recommendations_operations import BenefitRecommendationsOperations
+from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations
+from ._generate_benefit_utilization_summaries_report_operations import (
+ GenerateBenefitUtilizationSummariesReportOperations,
+)
+from ._budgets_operations import BudgetsOperations
from ._exports_operations import ExportsOperations
from ._generate_cost_details_report_operations import GenerateCostDetailsReportOperations
from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations
@@ -22,10 +22,16 @@
from ._generate_detailed_cost_report_operation_status_operations import (
GenerateDetailedCostReportOperationStatusOperations,
)
+from ._views_operations import ViewsOperations
+from ._alerts_operations import AlertsOperations
+from ._forecast_operations import ForecastOperations
+from ._dimensions_operations import DimensionsOperations
+from ._query_operations import QueryOperations
+from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations
from ._price_sheet_operations import PriceSheetOperations
from ._scheduled_actions_operations import ScheduledActionsOperations
-from ._benefit_recommendations_operations import BenefitRecommendationsOperations
-from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations
+from ._cost_allocation_rules_operations import CostAllocationRulesOperations
+from ._settings_operations import SettingsOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -33,21 +39,25 @@
__all__ = [
"Operations",
+ "BenefitRecommendationsOperations",
+ "BenefitUtilizationSummariesOperations",
+ "GenerateBenefitUtilizationSummariesReportOperations",
+ "BudgetsOperations",
+ "ExportsOperations",
+ "GenerateCostDetailsReportOperations",
+ "GenerateDetailedCostReportOperations",
+ "GenerateDetailedCostReportOperationResultsOperations",
+ "GenerateDetailedCostReportOperationStatusOperations",
"ViewsOperations",
"AlertsOperations",
"ForecastOperations",
"DimensionsOperations",
"QueryOperations",
"GenerateReservationDetailsReportOperations",
- "ExportsOperations",
- "GenerateCostDetailsReportOperations",
- "GenerateDetailedCostReportOperations",
- "GenerateDetailedCostReportOperationResultsOperations",
- "GenerateDetailedCostReportOperationStatusOperations",
"PriceSheetOperations",
"ScheduledActionsOperations",
- "BenefitRecommendationsOperations",
- "BenefitUtilizationSummariesOperations",
+ "CostAllocationRulesOperations",
+ "SettingsOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py
index 266574888da0..dcaf01d8f092 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py
@@ -26,7 +26,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +39,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -48,7 +48,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest:
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -63,7 +63,7 @@ def build_get_request(scope: str, alert_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -73,7 +73,7 @@ def build_get_request(scope: str, alert_id: str, **kwargs: Any) -> HttpRequest:
"alertId": _SERIALIZER.url("alert_id", alert_id, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -88,7 +88,7 @@ def build_dismiss_request(scope: str, alert_id: str, **kwargs: Any) -> HttpReque
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -99,7 +99,7 @@ def build_dismiss_request(scope: str, alert_id: str, **kwargs: Any) -> HttpReque
"alertId": _SERIALIZER.url("alert_id", alert_id, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -120,7 +120,7 @@ def build_list_external_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -135,7 +135,7 @@ def build_list_external_request(
"externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_recommendations_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_recommendations_operations.py
index 3503a1d3721e..af4891f04f48 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_recommendations_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_recommendations_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +47,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -56,7 +56,7 @@ def build_list_request(
"billingScope": _SERIALIZER.url("billing_scope", billing_scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
if filter is not None:
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_utilization_summaries_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_utilization_summaries_operations.py
index 3a8af9d96867..8fb880afe6f8 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_utilization_summaries_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_benefit_utilization_summaries_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +46,7 @@ def build_list_by_billing_account_id_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +58,7 @@ def build_list_by_billing_account_id_request(
"billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -84,7 +84,7 @@ def build_list_by_billing_profile_id_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -97,7 +97,7 @@ def build_list_by_billing_profile_id_request(
"billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -122,7 +122,7 @@ def build_list_by_savings_plan_order_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -134,7 +134,7 @@ def build_list_by_savings_plan_order_request(
"savingsPlanOrderId": _SERIALIZER.url("savings_plan_order_id", savings_plan_order_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -160,7 +160,7 @@ def build_list_by_savings_plan_id_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -173,7 +173,7 @@ def build_list_by_savings_plan_id_request(
"savingsPlanId": _SERIALIZER.url("savings_plan_id", savings_plan_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_budgets_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_budgets_operations.py
new file mode 100644
index 000000000000..9611c116e101
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_budgets_operations.py
@@ -0,0 +1,825 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+from .._vendor import _convert_request
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_list_request(scope: str, *, filter: Optional[str] = None, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/budgets")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_get_request(scope: str, budget_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "budgetName": _SERIALIZER.url(
+ "budget_name", budget_name, "str", max_length=63, min_length=1, pattern=r"^[a-zA-Z0-9_-]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_create_or_update_request(scope: str, budget_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "budgetName": _SERIALIZER.url(
+ "budget_name", budget_name, "str", max_length=63, min_length=1, pattern=r"^[a-zA-Z0-9_-]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_delete_request(scope: str, budget_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "budgetName": _SERIALIZER.url(
+ "budget_name", budget_name, "str", max_length=63, min_length=1, pattern=r"^[a-zA-Z0-9_-]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class BudgetsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.CostManagementClient`'s
+ :attr:`budgets` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(self, scope: str, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Budget"]:
+ """Lists all budgets for the defined scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param filter: OData filter option. May be used to filter budgets by properties/category. The
+ filter supports 'eq' only. Default value is None.
+ :type filter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either Budget or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.Budget]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.BudgetsListResult] = kwargs.pop("cls", None)
+
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ request = build_list_request(
+ scope=scope,
+ filter=filter,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+ request.method = "GET"
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("BudgetsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets"}
+
+ @distributed_trace
+ def get(self, scope: str, budget_name: str, **kwargs: Any) -> _models.Budget:
+ """Gets the budget for the scope by budget name.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.Budget] = kwargs.pop("cls", None)
+
+ request = build_get_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ template_url=self.get.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
+
+ @overload
+ def create_or_update(
+ self,
+ scope: str,
+ budget_name: str,
+ parameters: _models.Budget,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Required.
+ :type parameters: ~azure.mgmt.costmanagement.models.Budget
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self, scope: str, budget_name: str, parameters: IO, *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Required.
+ :type parameters: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def create_or_update(
+ self, scope: str, budget_name: str, parameters: Union[_models.Budget, IO], **kwargs: Any
+ ) -> _models.Budget:
+ """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.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :param parameters: Parameters supplied to the Create Budget operation. Is either a Budget type
+ or a IO type. Required.
+ :type parameters: ~azure.mgmt.costmanagement.models.Budget or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Budget or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Budget
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Budget] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Budget")
+
+ request = build_create_or_update_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("Budget", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self, scope: str, budget_name: str, **kwargs: Any
+ ) -> None:
+ """The operation to delete a budget.
+
+ .. seealso::
+ - https://docs.microsoft.com/en-us/rest/api/CostManagement/
+
+ :param scope: The scope associated with budget operations.
+
+ Supported scopes for **CategoryType: Cost**
+
+ Azure RBAC Scopes:
+
+
+ * '/subscriptions/{subscriptionId}/' for subscription scope
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
+ *
+ '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
+ scope
+
+ EA (Enterprise Agreement) Scopes:
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ for Department scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ for EnrollmentAccount scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
+ for invoiceSection scope
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only)
+
+ Supported scopes for **CategoryType: ReservationUtilization**
+
+ EA (Enterprise Agreement) Scopes:
+
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
+
+ MCA (Modern Customer Agreement) Scopes:
+
+
+ *
+ '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billingProfile scope (non-CSP only)
+ * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for
+ customer scope (CSP only). Required.
+ :type scope: str
+ :param budget_name: Budget Name. Required.
+ :type budget_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_request(
+ scope=scope,
+ budget_name=budget_name,
+ api_version=api_version,
+ template_url=self.delete.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}"}
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_cost_allocation_rules_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_cost_allocation_rules_operations.py
new file mode 100644
index 000000000000..a6dd66c06db1
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_cost_allocation_rules_operations.py
@@ -0,0 +1,698 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+from .._vendor import _convert_request
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_list_request(billing_account_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_check_name_availability_request(billing_account_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/checkNameAvailability",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_get_request(billing_account_id: str, rule_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", pattern=r"[A-Za-z0-9\-_]+"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_create_or_update_request(billing_account_id: str, rule_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", pattern=r"[A-Za-z0-9\-_]+"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_delete_request(billing_account_id: str, rule_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", pattern=r"[A-Za-z0-9\-_]+"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class CostAllocationRulesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.CostManagementClient`'s
+ :attr:`cost_allocation_rules` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(self, billing_account_id: str, **kwargs: Any) -> Iterable["_models.CostAllocationRuleDefinition"]:
+ """Get the list of all cost allocation rules for a billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CostAllocationRuleDefinition or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.CostAllocationRuleList] = kwargs.pop("cls", None)
+
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ request = build_list_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+ request.method = "GET"
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("CostAllocationRuleList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ list.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules"
+ }
+
+ @overload
+ def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: _models.CostAllocationRuleCheckNameAvailabilityRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Required.
+ :type cost_allocation_rule_check_name_availability_request:
+ ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Required.
+ :type cost_allocation_rule_check_name_availability_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def check_name_availability(
+ self,
+ billing_account_id: str,
+ cost_allocation_rule_check_name_availability_request: Union[
+ _models.CostAllocationRuleCheckNameAvailabilityRequest, IO
+ ],
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleCheckNameAvailabilityResponse:
+ """Checks availability and correctness of a name for a cost allocation rule.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param cost_allocation_rule_check_name_availability_request: Cost allocation rule to be created
+ or updated. Is either a CostAllocationRuleCheckNameAvailabilityRequest type or a IO type.
+ Required.
+ :type cost_allocation_rule_check_name_availability_request:
+ ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleCheckNameAvailabilityResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.CostAllocationRuleCheckNameAvailabilityResponse] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(cost_allocation_rule_check_name_availability_request, (IOBase, bytes)):
+ _content = cost_allocation_rule_check_name_availability_request
+ else:
+ _json = self._serialize.body(
+ cost_allocation_rule_check_name_availability_request, "CostAllocationRuleCheckNameAvailabilityRequest"
+ )
+
+ request = build_check_name_availability_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.check_name_availability.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("CostAllocationRuleCheckNameAvailabilityResponse", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ check_name_availability.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/checkNameAvailability"
+ }
+
+ @distributed_trace
+ def get(self, billing_account_id: str, rule_name: str, **kwargs: Any) -> _models.CostAllocationRuleDefinition:
+ """Get a cost allocation rule by rule name and billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.CostAllocationRuleDefinition] = kwargs.pop("cls", None)
+
+ request = build_get_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ template_url=self.get.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
+
+ @overload
+ def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: _models.CostAllocationRuleDefinition,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Required.
+ :type cost_allocation_rule: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Required.
+ :type cost_allocation_rule: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ billing_account_id: str,
+ rule_name: str,
+ cost_allocation_rule: Union[_models.CostAllocationRuleDefinition, IO],
+ **kwargs: Any
+ ) -> _models.CostAllocationRuleDefinition:
+ """Create/Update a rule to allocate cost between different resources within a billing account or
+ enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :param cost_allocation_rule: Cost allocation rule to be created or updated. Is either a
+ CostAllocationRuleDefinition type or a IO type. Required.
+ :type cost_allocation_rule: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition or
+ IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CostAllocationRuleDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.CostAllocationRuleDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.CostAllocationRuleDefinition] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(cost_allocation_rule, (IOBase, bytes)):
+ _content = cost_allocation_rule
+ else:
+ _json = self._serialize.body(cost_allocation_rule, "CostAllocationRuleDefinition")
+
+ request = build_create_or_update_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("CostAllocationRuleDefinition", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self, billing_account_id: str, rule_name: str, **kwargs: Any
+ ) -> None:
+ """Delete cost allocation rule for billing account or enterprise enrollment.
+
+ :param billing_account_id: BillingAccount ID. Required.
+ :type billing_account_id: str
+ :param rule_name: Cost allocation rule name. The name cannot include spaces or any non
+ alphanumeric characters other than '_' and '-'. The max length is 260 characters. Required.
+ :type rule_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_request(
+ billing_account_id=billing_account_id,
+ rule_name=rule_name,
+ api_version=api_version,
+ template_url=self.delete.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}"
+ }
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py
index 19dec07c7dc7..d5de3f24e2c6 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +48,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -57,7 +57,7 @@ def build_list_request(
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,7 +89,7 @@ def build_by_external_cloud_provider_type_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +104,7 @@ def build_by_external_cloud_provider_type_request(
"externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py
index e747255baa54..21b4965c48b9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py
@@ -26,7 +26,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +39,7 @@ def build_list_request(scope: str, *, expand: Optional[str] = None, **kwargs: An
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -48,7 +48,7 @@ def build_list_request(scope: str, *, expand: Optional[str] = None, **kwargs: An
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -65,7 +65,7 @@ def build_get_request(scope: str, export_name: str, *, expand: Optional[str] = N
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -75,7 +75,7 @@ def build_get_request(scope: str, export_name: str, *, expand: Optional[str] = N
"exportName": _SERIALIZER.url("export_name", export_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -92,7 +92,7 @@ def build_create_or_update_request(scope: str, export_name: str, **kwargs: Any)
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -103,7 +103,7 @@ def build_create_or_update_request(scope: str, export_name: str, **kwargs: Any)
"exportName": _SERIALIZER.url("export_name", export_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -120,7 +120,7 @@ def build_delete_request(scope: str, export_name: str, **kwargs: Any) -> HttpReq
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -130,7 +130,7 @@ def build_delete_request(scope: str, export_name: str, **kwargs: Any) -> HttpReq
"exportName": _SERIALIZER.url("export_name", export_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -145,7 +145,7 @@ def build_execute_request(scope: str, export_name: str, **kwargs: Any) -> HttpRe
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -155,7 +155,7 @@ def build_execute_request(scope: str, export_name: str, **kwargs: Any) -> HttpRe
"exportName": _SERIALIZER.url("export_name", export_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -170,7 +170,7 @@ def build_get_execution_history_request(scope: str, export_name: str, **kwargs:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -180,7 +180,7 @@ def build_get_execution_history_request(scope: str, export_name: str, **kwargs:
"exportName": _SERIALIZER.url("export_name", export_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py
index e39d94f30f09..4dede29492dd 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py
@@ -26,7 +26,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +39,7 @@ def build_usage_request(scope: str, *, filter: Optional[str] = None, **kwargs: A
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -49,7 +49,7 @@ def build_usage_request(scope: str, *, filter: Optional[str] = None, **kwargs: A
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
if filter is not None:
@@ -74,7 +74,7 @@ def build_external_cloud_provider_usage_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -90,7 +90,7 @@ def build_external_cloud_provider_usage_request(
"externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
if filter is not None:
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_operations.py
new file mode 100644
index 000000000000..5958cdf2d75b
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_operations.py
@@ -0,0 +1,1680 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models as _models
+from .._serialization import Serializer
+from .._vendor import _convert_request
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_generate_by_billing_account_request(billing_account_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_generate_by_billing_profile_request(
+ billing_account_id: str, billing_profile_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
+ "billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_generate_by_reservation_order_id_request(reservation_order_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "reservationOrderId": _SERIALIZER.url("reservation_order_id", reservation_order_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_generate_by_reservation_id_request(
+ reservation_order_id: str, reservation_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "reservationOrderId": _SERIALIZER.url("reservation_order_id", reservation_order_id, "str"),
+ "reservationId": _SERIALIZER.url("reservation_id", reservation_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_generate_by_savings_plan_order_id_request(savings_plan_order_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "savingsPlanOrderId": _SERIALIZER.url("savings_plan_order_id", savings_plan_order_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_generate_by_savings_plan_id_request(
+ savings_plan_order_id: str, savings_plan_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "savingsPlanOrderId": _SERIALIZER.url("savings_plan_order_id", savings_plan_order_id, "str"),
+ "savingsPlanId": _SERIALIZER.url("savings_plan_id", savings_plan_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class GenerateBenefitUtilizationSummariesReportOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.CostManagementClient`'s
+ :attr:`generate_benefit_utilization_summaries_report` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ def _generate_by_billing_account_initial(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_billing_account_request(
+ billing_account_id=billing_account_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_billing_account_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_billing_account_initial.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_billing_account(
+ self,
+ billing_account_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account.
+ This API supports only enrollment accounts.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_billing_account_initial(
+ billing_account_id=billing_account_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_billing_account.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ def _generate_by_billing_profile_initial(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_billing_profile_request(
+ billing_account_id=billing_account_id,
+ billing_profile_id=billing_profile_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_billing_profile_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_billing_profile_initial.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_billing_profile(
+ self,
+ billing_account_id: str,
+ billing_profile_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided billing account
+ and billing profile.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param billing_account_id: Billing account ID. Required.
+ :type billing_account_id: str
+ :param billing_profile_id: Billing profile ID. Required.
+ :type billing_profile_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_billing_profile_initial(
+ billing_account_id=billing_account_id,
+ billing_profile_id=billing_profile_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_billing_profile.metadata = {
+ "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ def _generate_by_reservation_order_id_initial(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_reservation_order_id_request(
+ reservation_order_id=reservation_order_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_reservation_order_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_reservation_order_id_initial.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_reservation_order_id(
+ self,
+ reservation_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_reservation_order_id_initial(
+ reservation_order_id=reservation_order_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_reservation_order_id.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ def _generate_by_reservation_id_initial(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_reservation_id_request(
+ reservation_order_id=reservation_order_id,
+ reservation_id=reservation_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_reservation_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_reservation_id_initial.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_reservation_id(
+ self,
+ reservation_order_id: str,
+ reservation_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided reservation.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param reservation_order_id: Reservation Order ID. Required.
+ :type reservation_order_id: str
+ :param reservation_id: Reservation ID. Required.
+ :type reservation_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_reservation_id_initial(
+ reservation_order_id=reservation_order_id,
+ reservation_id=reservation_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_reservation_id.metadata = {
+ "url": "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ def _generate_by_savings_plan_order_id_initial(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_savings_plan_order_id_request(
+ savings_plan_order_id=savings_plan_order_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_savings_plan_order_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_savings_plan_order_id_initial.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_savings_plan_order_id(
+ self,
+ savings_plan_order_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan
+ order.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_savings_plan_order_id_initial(
+ savings_plan_order_id=savings_plan_order_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_savings_plan_order_id.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ def _generate_by_savings_plan_id_initial(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> Optional[_models.BenefitUtilizationSummariesOperationStatus]:
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Optional[_models.BenefitUtilizationSummariesOperationStatus]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(benefit_utilization_summaries_request, (IOBase, bytes)):
+ _content = benefit_utilization_summaries_request
+ else:
+ _json = self._serialize.body(benefit_utilization_summaries_request, "BenefitUtilizationSummariesRequest")
+
+ request = build_generate_by_savings_plan_id_request(
+ savings_plan_order_id=savings_plan_order_id,
+ savings_plan_id=savings_plan_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self._generate_by_savings_plan_id_initial.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = None
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+
+ _generate_by_savings_plan_id_initial.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
+
+ @overload
+ def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: _models.BenefitUtilizationSummariesRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Required.
+ :type benefit_utilization_summaries_request: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_generate_by_savings_plan_id(
+ self,
+ savings_plan_order_id: str,
+ savings_plan_id: str,
+ benefit_utilization_summaries_request: Union[_models.BenefitUtilizationSummariesRequest, IO],
+ **kwargs: Any
+ ) -> LROPoller[_models.BenefitUtilizationSummariesOperationStatus]:
+ """Triggers generation of a benefit utilization summaries report for the provided savings plan.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param savings_plan_order_id: Savings plan order ID. Required.
+ :type savings_plan_order_id: str
+ :param savings_plan_id: Savings plan ID. Required.
+ :type savings_plan_id: str
+ :param benefit_utilization_summaries_request: Async Benefit Utilization Summary report to be
+ created. Is either a BenefitUtilizationSummariesRequest type or a IO type. Required.
+ :type benefit_utilization_summaries_request:
+ ~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesRequest or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either
+ BenefitUtilizationSummariesOperationStatus or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.BenefitUtilizationSummariesOperationStatus]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.BenefitUtilizationSummariesOperationStatus] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._generate_by_savings_plan_id_initial(
+ savings_plan_order_id=savings_plan_order_id,
+ savings_plan_id=savings_plan_id,
+ benefit_utilization_summaries_request=benefit_utilization_summaries_request,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("BenefitUtilizationSummariesOperationStatus", pipeline_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ begin_generate_by_savings_plan_id.metadata = {
+ "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport"
+ }
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_cost_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_cost_details_report_operations.py
index 7f9f5529f879..0618e058e208 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_cost_details_report_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_cost_details_report_operations.py
@@ -28,7 +28,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +41,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -51,7 +51,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest:
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -68,7 +68,7 @@ def build_get_operation_results_request(scope: str, operation_id: str, **kwargs:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -80,7 +80,7 @@ def build_get_operation_results_request(scope: str, operation_id: str, **kwargs:
"operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -201,13 +201,14 @@ def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Required.
:type parameters: ~azure.mgmt.costmanagement.models.GenerateCostDetailsReportRequestDefinition
@@ -244,13 +245,14 @@ def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Required.
:type parameters: IO
@@ -287,13 +289,14 @@ def begin_create_operation(
response along with details on the report blob(s) that are available for download. The details
on the file(s) available for download will be available in the polling response body. To
Understand cost details (formerly known as usage details) fields found in files ,see
- https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields.
+ https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param parameters: Parameters supplied to the Create cost details operation. Is either a
GenerateCostDetailsReportRequestDefinition type or a IO type. Required.
@@ -423,8 +426,9 @@ def begin_get_operation_results(
"""Get the result of the specified operation. This link is provided in the CostDetails creation
request response Location header.
- :param scope: The ARM Resource ID for subscription, resource group, billing account, or other
- billing scopes. For details, see https://aka.ms/costmgmt/scopes. Required.
+ :param scope: The ARM Resource ID for subscription, billing account, or other billing
+ scopes.Currently Resource Group and Management Group are not supported. For details, see
+ https://aka.ms/costmgmt/scopes. Required.
:type scope: str
:param operation_id: The target operation Id. Required.
:type operation_id: str
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py
index fe9816fc945f..cd5ec1fe97d8 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +40,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -50,7 +50,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py
index 35352c896734..e9da23166087 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py
@@ -25,7 +25,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -38,7 +38,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -48,7 +48,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py
index d97dc71e376c..313bf2efab04 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py
@@ -28,7 +28,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +41,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -51,7 +51,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest:
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py
index acfd66c3eca0..eb2ed736bd8d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,7 +42,7 @@ def build_by_billing_account_id_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -54,7 +54,7 @@ def build_by_billing_account_id_request(
"billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["startDate"] = _SERIALIZER.query("start_date", start_date, "str")
@@ -73,7 +73,7 @@ def build_by_billing_profile_id_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -86,7 +86,7 @@ def build_by_billing_profile_id_request(
"billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["startDate"] = _SERIALIZER.query("start_date", start_date, "str")
@@ -184,7 +184,7 @@ def begin_by_billing_account_id(
"""Generates the reservations details report for provided date range asynchronously based on
enrollment id. The Reservation usage details can be viewed only by certain enterprise roles.
For more details on the roles see,
- https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role.
+ https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
@@ -323,7 +323,7 @@ def begin_by_billing_profile_id(
"""Generates the reservations details report for provided date range asynchronously by billing
profile. The Reservation usage details can be viewed by only certain enterprise roles by
default. For more details on the roles see,
- https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access.
+ https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access.
.. seealso::
- https://docs.microsoft.com/en-us/rest/api/costmanagement/
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py
index d227fb63fadc..6bbea0092eb4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py
@@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_price_sheet_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_price_sheet_operations.py
index 708b3b455e76..40775ccc32e6 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_price_sheet_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_price_sheet_operations.py
@@ -27,7 +27,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,7 +42,7 @@ def build_download_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,7 +63,7 @@ def build_download_request(
"invoiceName": _SERIALIZER.url("invoice_name", invoice_name, "str", pattern=r"[A-Za-z0-9]+"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -80,7 +80,7 @@ def build_download_by_billing_profile_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +100,7 @@ def build_download_by_billing_profile_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py
index 6438c2d581b9..a3af108fb96f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py
@@ -26,7 +26,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +39,7 @@ def build_usage_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -49,7 +49,7 @@ def build_usage_request(scope: str, **kwargs: Any) -> HttpRequest:
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -70,7 +70,7 @@ def build_usage_by_external_cloud_provider_type_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -86,7 +86,7 @@ def build_usage_by_external_cloud_provider_type_request(
"externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_scheduled_actions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_scheduled_actions_operations.py
index c50ba6872037..5c434c6f15f8 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_scheduled_actions_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_scheduled_actions_operations.py
@@ -28,7 +28,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +41,7 @@ def build_list_request(*, filter: Optional[str] = None, **kwargs: Any) -> HttpRe
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -62,7 +62,7 @@ def build_list_by_scope_request(scope: str, *, filter: Optional[str] = None, **k
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -71,7 +71,7 @@ def build_list_by_scope_request(scope: str, *, filter: Optional[str] = None, **k
"scope": _SERIALIZER.url("scope", scope, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -88,7 +88,7 @@ def build_create_or_update_request(name: str, *, if_match: Optional[str] = None,
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -98,7 +98,7 @@ def build_create_or_update_request(name: str, *, if_match: Optional[str] = None,
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -117,7 +117,7 @@ def build_get_request(name: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -126,7 +126,7 @@ def build_get_request(name: str, **kwargs: Any) -> HttpRequest:
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -141,7 +141,7 @@ def build_delete_request(name: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -150,7 +150,7 @@ def build_delete_request(name: str, **kwargs: Any) -> HttpRequest:
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -167,7 +167,7 @@ def build_create_or_update_by_scope_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -178,7 +178,7 @@ def build_create_or_update_by_scope_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -197,7 +197,7 @@ def build_get_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -207,7 +207,7 @@ def build_get_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -222,7 +222,7 @@ def build_delete_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpR
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -232,7 +232,7 @@ def build_delete_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpR
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -247,7 +247,7 @@ def build_run_request(name: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -256,7 +256,7 @@ def build_run_request(name: str, **kwargs: Any) -> HttpRequest:
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -271,7 +271,7 @@ def build_run_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -281,7 +281,7 @@ def build_run_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -296,7 +296,7 @@ def build_check_name_availability_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -318,7 +318,7 @@ def build_check_name_availability_by_scope_request(scope: str, **kwargs: Any) ->
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -328,7 +328,7 @@ def build_check_name_availability_by_scope_request(scope: str, **kwargs: Any) ->
"scope": _SERIALIZER.url("scope", scope, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py
new file mode 100644
index 000000000000..a310fa4f3967
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py
@@ -0,0 +1,501 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpResponse
+from azure.core.rest import HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+from .._vendor import _convert_request
+
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_list_request(scope: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/settings")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_create_or_update_by_scope_request(
+ scope: str, type: Union[str, _models.SettingType], **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/settings/{type}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str"),
+ "type": _SERIALIZER.url("type", type, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_get_by_scope_request(scope: str, type: Union[str, _models.SettingType], **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/settings/{type}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str"),
+ "type": _SERIALIZER.url("type", type, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_delete_by_scope_request(scope: str, type: Union[str, _models.SettingType], **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/settings/{type}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str"),
+ "type": _SERIALIZER.url("type", type, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class SettingsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.costmanagement.CostManagementClient`'s
+ :attr:`settings` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(self, scope: str, **kwargs: Any) -> _models.SettingsListResult:
+ """List all cost management settings in the requested scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SettingsListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.SettingsListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SettingsListResult] = kwargs.pop("cls", None)
+
+ request = build_list_request(
+ scope=scope,
+ api_version=api_version,
+ template_url=self.list.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SettingsListResult", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings"}
+
+ @overload
+ def create_or_update_by_scope(
+ self,
+ scope: str,
+ type: Union[str, _models.SettingType],
+ setting: _models.Setting,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Required.
+ :type setting: ~azure.mgmt.costmanagement.models.Setting
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update_by_scope(
+ self,
+ scope: str,
+ type: Union[str, _models.SettingType],
+ setting: IO,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Required.
+ :type setting: IO
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def create_or_update_by_scope(
+ self, scope: str, type: Union[str, _models.SettingType], setting: Union[_models.Setting, IO], **kwargs: Any
+ ) -> _models.Setting:
+ """Create or update a setting within the given scope.
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :param setting: Setting to be created or updated. Is either a Setting type or a IO type.
+ Required.
+ :type setting: ~azure.mgmt.costmanagement.models.Setting or IO
+ :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
+ Default value is None.
+ :paramtype content_type: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Setting] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(setting, (IOBase, bytes)):
+ _content = setting
+ else:
+ _json = self._serialize.body(setting, "Setting")
+
+ request = build_create_or_update_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ template_url=self.create_or_update_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
+
+ @distributed_trace
+ def get_by_scope(self, scope: str, type: Union[str, _models.SettingType], **kwargs: Any) -> _models.Setting:
+ """Get the setting from the given scope by name.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Setting or the result of cls(response)
+ :rtype: ~azure.mgmt.costmanagement.models.Setting
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.Setting] = kwargs.pop("cls", None)
+
+ request = build_get_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ template_url=self.get_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Setting", pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+
+ get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
+
+ @distributed_trace
+ def delete_by_scope( # pylint: disable=inconsistent-return-statements
+ self, scope: str, type: Union[str, _models.SettingType], **kwargs: Any
+ ) -> None:
+ """Delete a setting within the given scope.
+
+ .. seealso::
+ - https://docs.microsoft.com/rest/api/cost-management/
+
+ :param scope: The scope associated with this setting. This includes
+ 'subscriptions/{subscriptionId}' for subscription scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
+ 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ for billing profile scope. Required.
+ :type scope: str
+ :param type: Setting type. "taginheritance" Required.
+ :type type: str or ~azure.mgmt.costmanagement.models.SettingType
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ request = build_delete_by_scope_request(
+ scope=scope,
+ type=type,
+ api_version=api_version,
+ template_url=self.delete_by_scope.metadata["url"],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/settings/{type}"}
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py
index 421a20005715..7f93d78c65f4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py
@@ -28,7 +28,7 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
+from .._vendor import _convert_request
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +41,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +60,7 @@ def build_list_by_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -69,7 +69,7 @@ def build_list_by_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
"scope": _SERIALIZER.url("scope", scope, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -84,7 +84,7 @@ def build_get_request(view_name: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -93,7 +93,7 @@ def build_get_request(view_name: str, **kwargs: Any) -> HttpRequest:
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -108,7 +108,7 @@ def build_create_or_update_request(view_name: str, **kwargs: Any) -> HttpRequest
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -118,7 +118,7 @@ def build_create_or_update_request(view_name: str, **kwargs: Any) -> HttpRequest
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -135,7 +135,7 @@ def build_delete_request(view_name: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -144,7 +144,7 @@ def build_delete_request(view_name: str, **kwargs: Any) -> HttpRequest:
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -159,7 +159,7 @@ def build_get_by_scope_request(scope: str, view_name: str, **kwargs: Any) -> Htt
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -169,7 +169,7 @@ def build_get_by_scope_request(scope: str, view_name: str, **kwargs: Any) -> Htt
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -184,7 +184,7 @@ def build_create_or_update_by_scope_request(scope: str, view_name: str, **kwargs
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -195,7 +195,7 @@ def build_create_or_update_by_scope_request(scope: str, view_name: str, **kwargs
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -212,7 +212,7 @@ def build_delete_by_scope_request(scope: str, view_name: str, **kwargs: Any) ->
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -222,7 +222,7 @@ def build_delete_by_scope_request(scope: str, view_name: str, **kwargs: Any) ->
"viewName": _SERIALIZER.url("view_name", view_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py
index 92332e0a8bf2..d2b17355371a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitRecommendationsByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_account.py
new file mode 100644
index 000000000000..db938c840ef4
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_account.py
@@ -0,0 +1,45 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_billing_account.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_billing_account(
+ billing_account_id="8099099",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "kind": "Reservation",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingAccount.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_profile.py
new file mode 100644
index 000000000000..d753851544c7
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_profile.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_billing_profile.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_billing_profile(
+ billing_account_id="00000000-0000-0000-0000-000000000000",
+ billing_profile_id="CZSFR-SDFXC-DSDF",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "kind": "Reservation",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingProfile.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation.py
new file mode 100644
index 000000000000..23893edf4f4f
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation.py
@@ -0,0 +1,45 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_reservation.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_reservation_id(
+ reservation_order_id="00000000-0000-0000-0000-000000000000",
+ reservation_id="00000000-0000-0000-0000-000000000000",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservation.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation_order.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation_order.py
new file mode 100644
index 000000000000..3fe869971425
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation_order.py
@@ -0,0 +1,44 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_reservation_order.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_reservation_order_id(
+ reservation_order_id="00000000-0000-0000-0000-000000000000",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservationOrder.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan.py
new file mode 100644
index 000000000000..14455181cffb
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan.py
@@ -0,0 +1,45 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_savings_plan.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_savings_plan_id(
+ savings_plan_order_id="00000000-0000-0000-0000-000000000000",
+ savings_plan_id="00000000-0000-0000-0000-000000000000",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlan.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan_order.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan_order.py
new file mode 100644
index 000000000000..ba2d07c9a3e2
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan_order.py
@@ -0,0 +1,44 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python generate_benefit_utilization_summaries_report_by_savings_plan_order.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.generate_benefit_utilization_summaries_report.begin_generate_by_savings_plan_order_id(
+ savings_plan_order_id="00000000-0000-0000-0000-000000000000",
+ benefit_utilization_summaries_request={
+ "endDate": "2022-08-31T00:00:00Z",
+ "grain": "Daily",
+ "startDate": "2022-06-01T00:00:00Z",
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlanOrder.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py
index c09892637945..5f3f39d412e1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py
index 83fd2506ae40..9fb5a59b7a1d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py
@@ -36,6 +36,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_id_monthly.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_id_monthly.py
index a3451662d9a5..c703bd78a8f4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_id_monthly.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_id_monthly.py
@@ -36,6 +36,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_order_id_daily.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_order_id_daily.py
index 6aa7f30f86ef..1a9f3e0209c1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_order_id_daily.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_order_id_daily.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_alerts.py
index b5bb07a53325..3e3c395585b0 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py
index f0e45e39ad6c..f4267c7ddb70 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py
index 874fc420c63d..c7064ddeb41c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py
index 02bd4d716cc0..faed3ce0ab39 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_forecast.py
index 1b4628647f41..3ecd34f54cbb 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py
index a7cae2acc067..cd81dcb0d226 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py
index 13b762d01fcf..08d7b3c0884e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingAccountQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_alerts.py
index e3d0e291e3a4..e3e6c28e1356 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingProfileAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingProfileAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_forecast.py
index 887aafbcf15e..b63e1117ac4f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingProfileForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/BillingProfileForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/cost/create_or_update_cost_subscription_budget.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/cost/create_or_update_cost_subscription_budget.py
new file mode 100644
index 000000000000..fe6a91f9692e
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/cost/create_or_update_cost_subscription_budget.py
@@ -0,0 +1,79 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python create_or_update_cost_subscription_budget.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ budget_name="TestBudget",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "amount": 100.65,
+ "category": "Cost",
+ "filter": {
+ "and": [
+ {
+ "dimensions": {
+ "name": "ResourceId",
+ "operator": "In",
+ "values": [
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2",
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1",
+ ],
+ }
+ },
+ {"tags": {"name": "category", "operator": "In", "values": ["Dev", "Prod"]}},
+ {"tags": {"name": "department", "operator": "In", "values": ["engineering", "sales"]}},
+ ]
+ },
+ "notifications": {
+ "Actual_GreaterThan_80_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "contactGroups": [
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup"
+ ],
+ "contactRoles": ["Contributor", "Reader"],
+ "enabled": True,
+ "locale": "en-us",
+ "operator": "GreaterThan",
+ "threshold": 80,
+ "thresholdType": "Actual",
+ }
+ },
+ "timeGrain": "Monthly",
+ "timePeriod": {"endDate": "2024-10-31T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule.py
new file mode 100644
index 000000000000..39c782ab08c0
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule.py
@@ -0,0 +1,59 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_ea_alert_rule.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/123456",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {},
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Weekly",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last7Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reservation_id_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reservation_id_filter.py
new file mode 100644
index 000000000000..2e4cb4f65759
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reservation_id_filter.py
@@ -0,0 +1,69 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_ea_alert_rule_reservation_id_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/123456",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservationId",
+ "operator": "In",
+ "values": [
+ "00000000-0000-0000-0000-000000000000",
+ "00000000-0000-0000-0000-000000000001",
+ "00000000-0000-0000-0000-000000000002",
+ ],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Weekly",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last7Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservationIdFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reserved_resource_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reserved_resource_type_filter.py
new file mode 100644
index 000000000000..cea118393817
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/ea/billing_account_ea_alert_rule_reserved_resource_type_filter.py
@@ -0,0 +1,65 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_ea_alert_rule_reserved_resource_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/123456",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservedResourceType",
+ "operator": "In",
+ "values": ["VirtualMachines", "SqlDatabases", "CosmosDb"],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Weekly",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last7Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule.py
new file mode 100644
index 000000000000..a0ef6edec5f8
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule.py
@@ -0,0 +1,59 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_profile_alert_rule.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {},
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reservation_id_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reservation_id_filter.py
new file mode 100644
index 000000000000..8420456112c7
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reservation_id_filter.py
@@ -0,0 +1,69 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_profile_alert_rule_reservation_id_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservationId",
+ "operator": "In",
+ "values": [
+ "00000000-0000-0000-0000-000000000000",
+ "00000000-0000-0000-0000-000000000001",
+ "00000000-0000-0000-0000-000000000002",
+ ],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservationIdFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reserved_resource_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reserved_resource_type_filter.py
new file mode 100644
index 000000000000..3b26028f58e1
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/billing_profile_alert_rule_reserved_resource_type_filter.py
@@ -0,0 +1,65 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_profile_alert_rule_reserved_resource_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservedResourceType",
+ "operator": "In",
+ "values": ["VirtualMachines", "SqlDatabases", "CosmosDb"],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservedResourceTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule.py
new file mode 100644
index 000000000000..d9a6deb13305
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule.py
@@ -0,0 +1,59 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python customer_alert_rule.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {},
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reservation_id_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reservation_id_filter.py
new file mode 100644
index 000000000000..8cf0eb80bf2e
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reservation_id_filter.py
@@ -0,0 +1,69 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python customer_alert_rule_reservation_id_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservationId",
+ "operator": "In",
+ "values": [
+ "00000000-0000-0000-0000-000000000000",
+ "00000000-0000-0000-0000-000000000001",
+ "00000000-0000-0000-0000-000000000002",
+ ],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservationIdFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reserved_resource_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reserved_resource_type_filter.py
new file mode 100644
index 000000000000..713463c9cc58
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/create_or_update/reservation_utilization/mca/customer_alert_rule_reserved_resource_type_filter.py
@@ -0,0 +1,65 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python customer_alert_rule_reserved_resource_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.create_or_update(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444",
+ budget_name="TestAlertRule",
+ parameters={
+ "eTag": '"1d34d016a593709"',
+ "properties": {
+ "category": "ReservationUtilization",
+ "filter": {
+ "dimensions": {
+ "name": "ReservedResourceType",
+ "operator": "In",
+ "values": ["VirtualMachines", "SqlDatabases", "CosmosDb"],
+ }
+ },
+ "notifications": {
+ "Actual_LessThan_99_Percent": {
+ "contactEmails": ["johndoe@contoso.com", "janesmith@contoso.com"],
+ "enabled": True,
+ "frequency": "Daily",
+ "locale": "en-us",
+ "operator": "LessThan",
+ "threshold": 99,
+ }
+ },
+ "timeGrain": "Last30Days",
+ "timePeriod": {"endDate": "2025-04-01T00:00:00Z", "startDate": "2023-04-01T00:00:00Z"},
+ },
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservedResourceTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/delete/delete_budget.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/delete/delete_budget.py
new file mode 100644
index 000000000000..4f3b6ddb3cf1
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/delete/delete_budget.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python delete_budget.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ client.budgets.delete(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ budget_name="TestBudget",
+ )
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/Delete/DeleteBudget.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/cost/get_cost_budget.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/cost/get_cost_budget.py
new file mode 100644
index 000000000000..e77eded9f8b6
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/cost/get_cost_budget.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python get_cost_budget.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.get(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ budget_name="TestBudget",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/Get/Cost/Get-Cost-Budget.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/reservation_utilization/get_reservation_utilization_alert_rule.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/reservation_utilization/get_reservation_utilization_alert_rule.py
new file mode 100644
index 000000000000..0da896ac0107
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/get/reservation_utilization/get_reservation_utilization_alert_rule.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python get_reservation_utilization_alert_rule.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.get(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN",
+ budget_name="TestAlertRule",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea.py
new file mode 100644
index 000000000000..30ad21961630
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_budgets_list_ea.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/123456",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea_category_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea_category_type_filter.py
new file mode 100644
index 000000000000..147a6947cda7
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/billing_account_budgets_list_ea_category_type_filter.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_budgets_list_ea_category_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/123456",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/department_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/department_budgets_list.py
new file mode 100644
index 000000000000..f84d5c0171bd
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/department_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python department_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/123456/departments/789101",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/EA/DepartmentBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/enrollment_account_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/enrollment_account_budgets_list.py
new file mode 100644
index 000000000000..7de679eaa2a1
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/ea/enrollment_account_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python enrollment_account_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca.py
new file mode 100644
index 000000000000..fb6d1894adee
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_budgets_list_mca.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca_category_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca_category_type_filter.py
new file mode 100644
index 000000000000..b4af658786c6
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_account_budgets_list_mca_category_type_filter.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_account_budgets_list_mca_category_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list.py
new file mode 100644
index 000000000000..4e777f43bf1a
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_profile_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/BillingProfileBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list_category_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list_category_type_filter.py
new file mode 100644
index 000000000000..5a5e10446375
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/billing_profile_budgets_list_category_type_filter.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python billing_profile_budgets_list_category_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list.py
new file mode 100644
index 000000000000..869b6e180360
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python customer_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/CustomerBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list_category_type_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list_category_type_filter.py
new file mode 100644
index 000000000000..747a72c1037a
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/customer_budgets_list_category_type_filter.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python customer_budgets_list_category_type_filter.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/CustomerBudgetsList-CategoryTypeFilter.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/invoice_section_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/invoice_section_budgets_list.py
new file mode 100644
index 000000000000..b1939176f6f2
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/mca/invoice_section_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python invoice_section_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/management_group_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/management_group_budgets_list.py
new file mode 100644
index 000000000000..fc5cfd02d429
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/management_group_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python management_group_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="Microsoft.Management/managementGroups/MYDEVTESTMG",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/resource_group_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/resource_group_budgets_list.py
new file mode 100644
index 000000000000..93f1e6289a43
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/resource_group_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python resource_group_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/RBAC/ResourceGroupBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/subscription_budgets_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/subscription_budgets_list.py
new file mode 100644
index 000000000000..a761c9cac071
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/budgets/list/rbac/subscription_budgets_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python subscription_budgets_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.budgets.list(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/Budgets/List/RBAC/SubscriptionBudgetsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_check_name_availability.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_check_name_availability.py
new file mode 100644
index 000000000000..d4fe4b1cad3a
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_check_name_availability.py
@@ -0,0 +1,43 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rule_check_name_availability.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.cost_allocation_rules.check_name_availability(
+ billing_account_id="100",
+ cost_allocation_rule_check_name_availability_request={
+ "name": "testRule",
+ "type": "Microsoft.CostManagement/costAllocationRules",
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRuleCheckNameAvailability.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create.py
new file mode 100644
index 000000000000..e1cbebccf88c
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create.py
@@ -0,0 +1,62 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rule_create.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.cost_allocation_rules.create_or_update(
+ billing_account_id="100",
+ rule_name="testRule",
+ cost_allocation_rule={
+ "properties": {
+ "description": "This is a testRule",
+ "details": {
+ "sourceResources": [
+ {"name": "ResourceGroupName", "resourceType": "Dimension", "values": ["sampleRG", "secondRG"]}
+ ],
+ "targetResources": [
+ {
+ "name": "ResourceGroupName",
+ "policyType": "FixedProportion",
+ "resourceType": "Dimension",
+ "values": [
+ {"name": "destinationRG", "percentage": 45},
+ {"name": "destinationRG2", "percentage": 54},
+ ],
+ }
+ ],
+ },
+ "status": "Active",
+ }
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRuleCreate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create_tag.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create_tag.py
new file mode 100644
index 000000000000..f4dd15bac6e6
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_create_tag.py
@@ -0,0 +1,61 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rule_create_tag.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.cost_allocation_rules.create_or_update(
+ billing_account_id="100",
+ rule_name="testRule",
+ cost_allocation_rule={
+ "properties": {
+ "description": "This is a testRule",
+ "details": {
+ "sourceResources": [{"name": "category", "resourceType": "Tag", "values": ["devops"]}],
+ "targetResources": [
+ {
+ "name": "ResourceGroupName",
+ "policyType": "FixedProportion",
+ "resourceType": "Dimension",
+ "values": [
+ {"name": "destinationRG", "percentage": 33.33},
+ {"name": "destinationRG2", "percentage": 33.33},
+ {"name": "destinationRG3", "percentage": 33.34},
+ ],
+ }
+ ],
+ },
+ "status": "Active",
+ }
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRuleCreateTag.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_delete.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_delete.py
new file mode 100644
index 000000000000..5d1414acd721
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_delete.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rule_delete.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ client.cost_allocation_rules.delete(
+ billing_account_id="100",
+ rule_name="testRule",
+ )
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRuleDelete.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_get.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_get.py
new file mode 100644
index 000000000000..0f660dd23050
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rule_get.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rule_get.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.cost_allocation_rules.get(
+ billing_account_id="100",
+ rule_name="testRule",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRuleGet.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rules_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rules_list.py
new file mode 100644
index 000000000000..1edc33c5a3af
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_allocation_rules_list.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python cost_allocation_rules_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.cost_allocation_rules.list(
+ billing_account_id="100",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostAllocationRulesList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py
index 5c2a8daab65e..d8a15f5b0276 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/CostDetailsOperationResultsBySubscriptionScope.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/CostDetailsOperationResultsBySubscriptionScope.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_alerts.py
index 88c238b30566..df9e3729a5d7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py
index a38421094702..2b9080fc1a16 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py
index 48935633c8ac..bd61a7b76dc9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py
index 23e65cb1cb0c..88e23180ec65 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_forecast.py
index 15b69c4b5200..c4a24ff14207 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py
index f31157b94afd..712d064607ad 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py
index 36c7d45875f4..73d330d4e08e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DepartmentQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py
index face8893712c..935d27544c72 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py
@@ -36,6 +36,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DismissResourceGroupAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DismissResourceGroupAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py
index 2da152c2d778..8df4d9546c91 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py
@@ -36,6 +36,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DismissSubscriptionAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/DismissSubscriptionAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_alerts.py
index 1e246acd55bb..0ae1ef43d745 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py
index e58b8e1c6003..e85a8b45b348 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py
index d730beedb0a2..1f939187c0fb 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py
index aa4098802237..61f586c9b81b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_forecast.py
index a418aca1b8b4..7f78c0730822 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py
index b62acd0963eb..94b2a1ec3401 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py
index 4a49084d6642..f515d64fe7ec 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/EnrollmentAccountQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_billing_account.py
index 24a9fdabca78..65d84d60038c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_billing_account.py
@@ -32,6 +32,8 @@ def main():
scope="providers/Microsoft.Billing/billingAccounts/123456",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_department.py
index ae5adf8565d1..5382aa199970 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_department.py
@@ -32,6 +32,8 @@ def main():
scope="providers/Microsoft.Billing/billingAccounts/12/departments/1234",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_enrollment_account.py
index 259dd8f62917..79c2b6561877 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_enrollment_account.py
@@ -32,6 +32,8 @@ def main():
scope="providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_management_group.py
index a69690f9e8c2..8e3fd66a8752 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_management_group.py
@@ -32,6 +32,8 @@ def main():
scope="providers/Microsoft.Management/managementGroups/TestMG",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_resource_group.py
index c8fa59257795..ffcd655e07cc 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_resource_group.py
@@ -32,6 +32,8 @@ def main():
scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_subscription.py
index 997f926419db..fe7bc23dec96 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_create_or_update_by_subscription.py
@@ -32,6 +32,8 @@ def main():
scope="subscriptions/00000000-0000-0000-0000-000000000000",
export_name="TestExport",
parameters={
+ "identity": {"type": "SystemAssigned"},
+ "location": "centralus",
"properties": {
"definition": {
"dataSet": {
@@ -54,12 +56,12 @@ def main():
"recurrencePeriod": {"from": "2020-06-01T00:00:00Z", "to": "2020-10-31T00:00:00Z"},
"status": "Active",
},
- }
+ },
},
)
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportCreateOrUpdateBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_billing_account.py
index 05c045b790fa..784ac839da99 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_billing_account.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_department.py
index ae811025f0a9..817662efb99c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_department.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_enrollment_account.py
index c108b4b337d1..7e1d1b97ed32 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_enrollment_account.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_management_group.py
index 4bf2f36a8622..eee17e8018c0 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_management_group.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_resource_group.py
index 82229e9bba7c..6845816e655c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_resource_group.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_subscription.py
index 427f2a9f9138..b74ec41bdcc2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_delete_by_subscription.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportDeleteBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_billing_account.py
index 8266b9a594d2..3706ec446673 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_billing_account.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_department.py
index e6aa15d5361c..abc973dfada3 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_department.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_enrollment_account.py
index 4960c604686d..7c1c47e447c1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_enrollment_account.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_management_group.py
index ac2e541426fc..8ca400b3434e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_management_group.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_resource_group.py
index 307fb98bd806..3bb0655c8fd4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_resource_group.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_subscription.py
index efbd1e8048b7..e13edb8727ef 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_get_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportGetBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_billing_account.py
index 97740984b3de..a5a6800c65b6 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_billing_account.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_department.py
index 64f869360de1..66f7656a60bb 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_department.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_enrollment_account.py
index 6e94d8ada049..ea7fcd3bf100 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_enrollment_account.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_management_group.py
index 8b0d53edc4d5..071af30234e7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_management_group.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_resource_group.py
index ab862471e963..ed2507cc8809 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_resource_group.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_subscription.py
index 4e61a79b18ac..b7a4bb097150 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_by_subscription.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_billing_account.py
index 199740876c6b..d5efdab46156 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_billing_account.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_department.py
index 380019a2e8e1..e48d3e6f134a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_department.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_enrollment_account.py
index 79922afbc76d..21f2f6975ab4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_enrollment_account.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_management_group.py
index 37d279c1cd97..d81af345c1b2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_management_group.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_resource_group.py
index 494201812bf2..28a0de834419 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_resource_group.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_subscription.py
index 4565b72e9911..4bd4333758ac 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/export_run_history_get_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportRunHistoryGetBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_billing_account.py
index 6562d9dddf91..2b79b06aa81e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_billing_account.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_department.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_department.py
index e5f7c4444277..a27c2ae31942 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_department.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_department.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByDepartment.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetByDepartment.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_enrollment_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_enrollment_account.py
index de0b8d7490a8..87ba6f5de6ad 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_enrollment_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_enrollment_account.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByEnrollmentAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetByEnrollmentAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_management_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_management_group.py
index 8b78725d765d..402ba438dd56 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_management_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_management_group.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByManagementGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetByManagementGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_resource_group.py
index b9662dd0ff45..2bce058a5353 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_resource_group.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_subscription.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_subscription.py
index 37fcdbd45b49..3bf509963212 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_subscription.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/exports_get_by_subscription.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetBySubscription.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExportsGetBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_alerts.py
index 779eb2320f80..7a68e678383b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_alerts.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalBillingAccountAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_forecast.py
index dc1bb420b118..5cf1a8963060 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_forecast.py
@@ -61,6 +61,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalBillingAccountForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py
index b764fdd3c0ed..e12188ea49df 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py
@@ -36,6 +36,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountsDimensions.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalBillingAccountsDimensions.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py
index 69b7503274a8..9b5008a78c34 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py
@@ -59,6 +59,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountsQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalBillingAccountsQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_alerts.py
index 24103f6c6562..aa5f29516aea 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_alerts.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalSubscriptionAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_forecast.py
index 39a6ed464e0f..93f3d5e39e07 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_forecast.py
@@ -61,6 +61,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalSubscriptionForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py
index ff8ef5e75164..bc7f92b185a7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py
@@ -36,6 +36,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionsDimensions.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalSubscriptionsDimensions.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_query.py
index 5879a5230481..dd6e09b811e1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_query.py
@@ -59,6 +59,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionsQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ExternalSubscriptionsQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_account_enterprise_agreement_customer_and_billing_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_account_enterprise_agreement_customer_and_billing_period.py
index 8fc7ecb2911b..2316dbc43650 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_account_enterprise_agreement_customer_and_billing_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_account_enterprise_agreement_customer_and_billing_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id.py
index 3cc8d1ae18e2..8d16c3d1827a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceId.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceId.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id_and_customer_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id_and_customer_id.py
index 7e38e26e351f..da9196485140 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id_and_customer_id.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_billing_profile_and_invoice_id_and_customer_id.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_customer_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_customer_and_time_period.py
index 1d9fb4013da7..e77d97707cd4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_customer_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_customer_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByCustomerAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByCustomerAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_departments_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_departments_and_time_period.py
index b7fd59c2d6f0..c33ef9badb97 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_departments_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_departments_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByDepartmentsAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByDepartmentsAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_enrollment_accounts_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_enrollment_accounts_and_time_period.py
index 05857cda0b19..9b3e0876115e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_enrollment_accounts_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_enrollment_accounts_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_subscription_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_subscription_and_time_period.py
index fa959fac4317..3a509b553abc 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_subscription_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_cost_details_report_by_subscription_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportBySubscriptionAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateCostDetailsReportBySubscriptionAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_account_legacy_and_billing_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_account_legacy_and_billing_period.py
index 6c9aba183fb6..0377776fc438 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_account_legacy_and_billing_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_account_legacy_and_billing_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id.py
index 171adc5bea17..20ba5f1dd7be 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id_and_customer_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id_and_customer_id.py
index 66e8751344e3..6d2f5e2803fb 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id_and_customer_id.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_billing_profile_and_invoice_id_and_customer_id.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_customer_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_customer_and_time_period.py
index 6b4c1c570c67..36b25d88d4f3 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_customer_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_customer_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByCustomerAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportByCustomerAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_subscription_and_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_subscription_and_time_period.py
index 002c901d4c44..7383f324e75a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_subscription_and_time_period.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_by_subscription_and_time_period.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py
index ad52d818c68e..51826b84490e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py
index faf3c338f455..056a0f9c188e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py
index 5cbf1f685c89..5cd263cdc73a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py
@@ -36,6 +36,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateReservationDetailsReportByBillingAccount.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateReservationDetailsReportByBillingAccount.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py
index 29acfba80850..be759b46077f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateReservationDetailsReportByBillingProfile.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/GenerateReservationDetailsReportByBillingProfile.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_alerts.py
index 24be92520b5e..274f42d13c81 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/InvoiceSectionAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/InvoiceSectionAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_forecast.py
index 5ca0635445f2..4ca031a9d411 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/InvoiceSectionForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/InvoiceSectionForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py
index a57a6252f33b..70ae7d6588c7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ManagementGroupDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py
index fd618f059528..49d8a9d3b76c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ManagementGroupDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py
index d6624fb9d858..4c72cc595b94 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ManagementGroupDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py
index 259ead41ae0e..63f1769be781 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ManagementGroupQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py
index fda6bddcc595..ca2b09fad1e5 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ManagementGroupQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py
index 9f7cba047e65..e3d4e67e40c9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingAccountDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py
index 659323eb7296..4baefaf0b9ac 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingAccountDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py
index 0f16db5f30bb..cd74a7a6de8e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingAccountDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py
index 7c8456bba766..e3d32b9028a2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingAccountQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py
index 3e3dffe50f13..0714fe1d14cf 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingAccountQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py
index f4b4e44b51d1..5faed74a16fb 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingProfileDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py
index 801c2ef43317..43a63d18ef0f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingProfileDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py
index ed2286ccfe72..4007428dd5e1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingProfileDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py
index bd56472dcdbb..dbef040eccc7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingProfileQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py
index cacb2c21e4d5..63395f01eccf 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCABillingProfileQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py
index 16ca7b1798a2..10777313f211 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCACustomerDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py
index b941fb680e48..f152536324bf 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCACustomerDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py
index 498fb66387df..a6dac3f503de 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCACustomerDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py
index 4dcb6efde3d4..4d6b156d4190 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCACustomerQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py
index c4c0ff727c0a..5bb415fa9c49 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCACustomerQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py
index 11b68a17f4d4..6923781b5af5 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCAInvoiceSectionDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py
index e449f04d320c..93205691c6ec 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsListExpandAndTop.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCAInvoiceSectionDimensionsListExpandAndTop.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py
index 14b352dfb098..10e8fbbdde2e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsListWithFilter.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCAInvoiceSectionDimensionsListWithFilter.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py
index 7a472df6af05..abbf2aee85c4 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCAInvoiceSectionQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py
index 2030ca2f13a1..eff00217b6f2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/MCAInvoiceSectionQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/operation_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/operation_list.py
index 6c325487a5b9..8cd4074bf9c6 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/operation_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/operation_list.py
@@ -33,6 +33,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/OperationList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download.py
index 2450cd629150..db3b5f0ea6d3 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download.py
@@ -36,6 +36,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PricesheetDownload.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PricesheetDownload.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download_by_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download_by_billing_profile.py
index e6a64be2fa83..b7ff3de97258 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download_by_billing_profile.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/pricesheet_download_by_billing_profile.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PricesheetDownloadByBillingProfile.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PricesheetDownloadByBillingProfile.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view.py
index 506133cc0ef2..e1f7b35d0d6e 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateView.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PrivateView.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py
index 5b4bfb8a3143..ea363de8c06c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py
@@ -66,6 +66,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewCreateOrUpdate.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PrivateViewCreateOrUpdate.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py
index cc5ae3b919e1..77dfa120c627 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py
@@ -33,6 +33,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewDelete.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PrivateViewDelete.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_list.py
index ff5ce767ac30..98ccebf301c9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_list.py
@@ -33,6 +33,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/PrivateViewList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_alerts.py
index 4d2c8998f9a0..e55e6cc2e317 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ResourceGroupAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py
index d8c4c9543dc6..3e529b1ff349 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ResourceGroupDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_forecast.py
index 4c7ea0276418..7e48012c041b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ResourceGroupForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py
index e4556d516b5f..560ce2f57ae7 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ResourceGroupQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py
index 1d63d0bafb57..f1c7efb95704 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ResourceGroupQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py
index 3fe817df9a29..b30f7e309648 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py
index 3527687cfd09..fead4dbe90e9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py
index eccd776b189f..b9b35a7f75ff 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py
@@ -51,6 +51,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py
index 957b8e9f1f5d..963ae27084fe 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py
@@ -53,6 +53,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py
index 9f37bab8ab05..5f6914ae2ae2 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py
@@ -33,6 +33,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-delete-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py
index b13e2b926cb2..248c8cccdd6c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-delete-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py
index baf04b00199f..94536afe8a67 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-get-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py
index b21a8394b3cf..f89b3f3a6d42 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-get-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py
index fa047b3903d5..99c34238a27d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py
@@ -52,6 +52,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py
index 602e727e9ef5..9db05a684195 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py
@@ -33,6 +33,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-sendNow-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-sendNow-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py
index 72401f901922..163ebbd8442c 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-sendNow-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledAction-sendNow-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py
index 229644b5997f..200c414d890b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py
@@ -33,6 +33,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py
index 9815805b19a2..2a90d38f4c43 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py
index 7e1bb07a89f8..1f2988a5172a 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py
@@ -33,6 +33,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-private.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledActions-list-private.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py
index 1ce7057cf63c..141e6e86e56b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-shared.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/scheduledActions/scheduledActions-list-shared.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingdelete.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingdelete.py
new file mode 100644
index 000000000000..5cd2b3804889
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingdelete.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python settingdelete.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ client.settings.delete_by_scope(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ type="taginheritance",
+ )
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/setting-delete.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingget.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingget.py
new file mode 100644
index 000000000000..7298d1967d16
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingget.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python settingget.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.settings.get_by_scope(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ type="taginheritance",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/setting-get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settings_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settings_list.py
new file mode 100644
index 000000000000..d47f115ee451
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settings_list.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python settings_list.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.settings.list(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/settingsList.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingscreate_or_update.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingscreate_or_update.py
new file mode 100644
index 000000000000..4a4a8df7fc66
--- /dev/null
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/settingscreate_or_update.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+from azure.mgmt.costmanagement import CostManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-costmanagement
+# USAGE
+ python settingscreate_or_update.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = CostManagementClient(
+ credential=DefaultAzureCredential(),
+ )
+
+ response = client.settings.create_or_update_by_scope(
+ scope="subscriptions/00000000-0000-0000-0000-000000000000",
+ type="taginheritance",
+ setting={"kind": "taginheritance", "properties": {"preferContainerTags": False}},
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/settings-createOrUpdate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py
index 9d9f5742c791..661d8d907aea 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SingleResourceGroupAlert.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SingleResourceGroupAlert.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py
index 3a504fe6fdb2..ea8c507a5fad 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SingleSubscriptionAlert.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SingleSubscriptionAlert.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_alerts.py
index 3402e29b0f72..d6d397175f1d 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_alerts.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_alerts.py
@@ -34,6 +34,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionAlerts.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SubscriptionAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py
index 7c82f57ea2ff..bdc198be6e01 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionDimensionsList.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SubscriptionDimensionsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_forecast.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_forecast.py
index 63c6ba54de7c..ee5039a156a1 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_forecast.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_forecast.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionForecast.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SubscriptionForecast.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py
index a80a9cb721c8..0fdd273d0f2f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionQuery.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SubscriptionQuery.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py
index 90f56b4f701e..d61892bebe0b 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py
@@ -43,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionQueryGrouping.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/SubscriptionQueryGrouping.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py
index 8ebf3ed7deec..141ab2b5c5c9 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py
@@ -35,6 +35,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ViewByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py
index 0c0f6a148b5b..44c94f9fe625 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py
@@ -67,6 +67,6 @@ def main():
print(response)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewCreateOrUpdateByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ViewCreateOrUpdateByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py
index 351d43f8c2f8..6cbbb0771f02 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py
@@ -34,6 +34,6 @@ def main():
)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewDeleteByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ViewDeleteByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py
index 13608bc5eb00..0b696a0b8c4f 100644
--- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py
+++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewListByResourceGroup.json
+# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-08-01/examples/ViewListByResourceGroup.json
if __name__ == "__main__":
main()