From 72fdd580ea0abf600f508e0dd59a015ac6a47548 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 5 Jun 2023 07:53:14 +0000 Subject: [PATCH] CodeGen from PR 24150 in Azure/azure-rest-api-specs Update Error Code to string (#24150) --- .../azure-mgmt-costmanagement/_meta.json | 6 +- .../mgmt/costmanagement/_configuration.py | 4 +- .../costmanagement/_cost_management_client.py | 84 +- .../azure/mgmt/costmanagement/_version.py | 2 +- .../mgmt/costmanagement/aio/_configuration.py | 4 +- .../aio/_cost_management_client.py | 84 +- .../costmanagement/aio/operations/__init__.py | 38 +- .../aio/operations/_alerts_operations.py | 3 +- .../aio/operations/_exports_operations.py | 3 +- .../aio/operations/_forecast_operations.py | 5 +- ...ation_summaries_report_async_operations.py | 299 ++++ ...utilization_summaries_report_operations.py | 1251 +++++++++++++++ ...generate_cost_details_report_operations.py | 3 +- ...enerate_detailed_cost_report_operations.py | 3 +- .../aio/operations/_query_operations.py | 5 +- .../_scheduled_actions_operations.py | 9 +- .../aio/operations/_views_operations.py | 5 +- .../mgmt/costmanagement/models/__init__.py | 14 + .../models/_cost_management_client_enums.py | 30 +- .../mgmt/costmanagement/models/_models_py3.py | 333 +++- .../costmanagement/operations/__init__.py | 38 +- .../operations/_alerts_operations.py | 11 +- .../_benefit_recommendations_operations.py | 2 +- ...enefit_utilization_summaries_operations.py | 8 +- .../operations/_dimensions_operations.py | 6 +- .../operations/_exports_operations.py | 15 +- .../operations/_forecast_operations.py | 11 +- ...ation_summaries_report_async_operations.py | 333 ++++ ...utilization_summaries_report_operations.py | 1404 +++++++++++++++++ ...generate_cost_details_report_operations.py | 7 +- ...ost_report_operation_results_operations.py | 2 +- ...cost_report_operation_status_operations.py | 2 +- ...enerate_detailed_cost_report_operations.py | 5 +- ...e_reservation_details_report_operations.py | 4 +- .../costmanagement/operations/_operations.py | 2 +- .../operations/_price_sheet_operations.py | 6 +- .../operations/_query_operations.py | 11 +- .../_scheduled_actions_operations.py | 37 +- .../operations/_views_operations.py | 21 +- ...efit_recommendations_by_billing_account.py | 2 +- ...ion_summaries_report_by_billing_account.py | 45 + ...ion_summaries_report_by_billing_profile.py | 46 + ...ization_summaries_report_by_reservation.py | 45 + ...n_summaries_report_by_reservation_order.py | 44 + ...zation_summaries_report_by_savings_plan.py | 45 + ..._summaries_report_by_savings_plan_order.py | 44 + .../savings_plan_billing_account.py | 2 +- .../savings_plan_billing_profile.py | 2 +- .../savings_plan_savings_plan_id_monthly.py | 2 +- ...avings_plan_savings_plan_order_id_daily.py | 2 +- .../billing_account_alerts.py | 2 +- .../billing_account_dimensions_list.py | 2 +- ..._account_dimensions_list_expand_and_top.py | 2 +- ...ing_account_dimensions_list_with_filter.py | 2 +- .../billing_account_forecast.py | 2 +- .../billing_account_query.py | 2 +- .../billing_account_query_grouping.py | 2 +- .../billing_profile_alerts.py | 2 +- .../billing_profile_forecast.py | 2 +- ...operation_results_by_subscription_scope.py | 2 +- .../generated_samples/department_alerts.py | 2 +- .../department_dimensions_list.py | 2 +- ...partment_dimensions_list_expand_and_top.py | 2 +- .../department_dimensions_list_with_filter.py | 2 +- .../generated_samples/department_forecast.py | 2 +- .../generated_samples/department_query.py | 2 +- .../department_query_grouping.py | 2 +- .../dismiss_resource_group_alerts.py | 2 +- .../dismiss_subscription_alerts.py | 2 +- .../enrollment_account_alerts.py | 2 +- .../enrollment_account_dimensions_list.py | 2 +- ..._account_dimensions_list_expand_and_top.py | 2 +- ...ent_account_dimensions_list_with_filter.py | 2 +- .../enrollment_account_forecast.py | 2 +- .../enrollment_account_query.py | 2 +- .../enrollment_account_query_grouping.py | 2 +- ...ort_create_or_update_by_billing_account.py | 2 +- .../export_create_or_update_by_department.py | 2 +- ..._create_or_update_by_enrollment_account.py | 2 +- ...rt_create_or_update_by_management_group.py | 2 +- ...port_create_or_update_by_resource_group.py | 2 +- ...export_create_or_update_by_subscription.py | 2 +- .../export_delete_by_billing_account.py | 5 +- .../export_delete_by_department.py | 5 +- .../export_delete_by_enrollment_account.py | 5 +- .../export_delete_by_management_group.py | 5 +- .../export_delete_by_resource_group.py | 5 +- .../export_delete_by_subscription.py | 5 +- .../export_get_by_billing_account.py | 2 +- .../export_get_by_department.py | 2 +- .../export_get_by_enrollment_account.py | 2 +- .../export_get_by_management_group.py | 2 +- .../export_get_by_resource_group.py | 2 +- .../export_get_by_subscription.py | 2 +- .../export_run_by_billing_account.py | 5 +- .../export_run_by_department.py | 5 +- .../export_run_by_enrollment_account.py | 5 +- .../export_run_by_management_group.py | 5 +- .../export_run_by_resource_group.py | 5 +- .../export_run_by_subscription.py | 5 +- ...port_run_history_get_by_billing_account.py | 2 +- .../export_run_history_get_by_department.py | 2 +- ...t_run_history_get_by_enrollment_account.py | 2 +- ...ort_run_history_get_by_management_group.py | 2 +- ...xport_run_history_get_by_resource_group.py | 2 +- .../export_run_history_get_by_subscription.py | 2 +- .../exports_get_by_billing_account.py | 2 +- .../exports_get_by_department.py | 2 +- .../exports_get_by_enrollment_account.py | 2 +- .../exports_get_by_management_group.py | 2 +- .../exports_get_by_resource_group.py | 2 +- .../exports_get_by_subscription.py | 2 +- .../external_billing_account_alerts.py | 2 +- .../external_billing_account_forecast.py | 2 +- .../external_billing_accounts_dimensions.py | 2 +- .../external_billing_accounts_query.py | 2 +- .../external_subscription_alerts.py | 2 +- .../external_subscription_forecast.py | 2 +- .../external_subscriptions_dimensions.py | 2 +- .../external_subscriptions_query.py | 2 +- ...e_agreement_customer_and_billing_period.py | 2 +- ...eport_by_billing_profile_and_invoice_id.py | 2 +- ..._profile_and_invoice_id_and_customer_id.py | 2 +- ...ails_report_by_customer_and_time_period.py | 2 +- ...s_report_by_departments_and_time_period.py | 2 +- ..._by_enrollment_accounts_and_time_period.py | 2 +- ..._report_by_subscription_and_time_period.py | 2 +- ...lling_account_legacy_and_billing_period.py | 2 +- ...eport_by_billing_profile_and_invoice_id.py | 2 +- ..._profile_and_invoice_id_and_customer_id.py | 2 +- ...cost_report_by_customer_and_time_period.py | 2 +- ..._report_by_subscription_and_time_period.py | 2 +- ...operation_results_by_subscription_scope.py | 2 +- ..._operation_status_by_subscription_scope.py | 2 +- ...ation_details_report_by_billing_account.py | 2 +- ...ation_details_report_by_billing_profile.py | 2 +- .../invoice_section_alerts.py | 2 +- .../invoice_section_forecast.py | 2 +- .../management_group_dimensions_list.py | 2 +- ...nt_group_dimensions_list_expand_and_top.py | 2 +- ...ement_group_dimensions_list_with_filter.py | 2 +- .../management_group_query.py | 2 +- .../management_group_query_grouping.py | 2 +- .../mca_billing_account_dimensions_list.py | 2 +- ..._account_dimensions_list_expand_and_top.py | 2 +- ...ing_account_dimensions_list_with_filter.py | 2 +- .../mca_billing_account_query.py | 2 +- .../mca_billing_account_query_grouping.py | 2 +- .../mca_billing_profile_dimensions_list.py | 2 +- ..._profile_dimensions_list_expand_and_top.py | 2 +- ...ing_profile_dimensions_list_with_filter.py | 2 +- .../mca_billing_profile_query.py | 2 +- .../mca_billing_profile_query_grouping.py | 2 +- .../mca_customer_dimensions_list.py | 2 +- ...customer_dimensions_list_expand_and_top.py | 2 +- ...ca_customer_dimensions_list_with_filter.py | 2 +- .../generated_samples/mca_customer_query.py | 2 +- .../mca_customer_query_grouping.py | 2 +- .../mca_invoice_section_dimensions_list.py | 2 +- ..._section_dimensions_list_expand_and_top.py | 2 +- ...ice_section_dimensions_list_with_filter.py | 2 +- .../mca_invoice_section_query.py | 2 +- .../mca_invoice_section_query_grouping.py | 2 +- .../generated_samples/operation_list.py | 2 +- .../generated_samples/pricesheet_download.py | 2 +- .../pricesheet_download_by_billing_profile.py | 2 +- .../generated_samples/private_view.py | 2 +- .../private_view_create_or_update.py | 2 +- .../generated_samples/private_view_delete.py | 5 +- .../generated_samples/private_view_list.py | 2 +- .../resource_group_alerts.py | 2 +- .../resource_group_dimensions_list.py | 2 +- .../resource_group_forecast.py | 2 +- .../generated_samples/resource_group_query.py | 2 +- .../resource_group_query_grouping.py | 2 +- ...ame_availabilityprivatescheduled_action.py | 2 +- ...name_availabilitysharedscheduled_action.py | 2 +- ...scheduled_actioncreate_or_updateprivate.py | 2 +- .../scheduled_actioncreate_or_updateshared.py | 2 +- .../scheduled_actiondeleteprivate.py | 5 +- .../scheduled_actiondeleteshared.py | 5 +- .../scheduled_actiongetprivate.py | 2 +- .../scheduled_actiongetshared.py | 2 +- ...tioninsight_alertcreate_or_updateshared.py | 2 +- .../scheduled_actionsend_nowprivate.py | 5 +- .../scheduled_actionsend_nowshared.py | 5 +- ...cheduled_actionslist_with_filterprivate.py | 2 +- ...scheduled_actionslist_with_filtershared.py | 2 +- .../scheduled_actionslistprivate.py | 2 +- .../scheduled_actionslistshared.py | 2 +- .../single_resource_group_alert.py | 2 +- .../single_subscription_alert.py | 2 +- .../generated_samples/subscription_alerts.py | 2 +- .../subscription_dimensions_list.py | 2 +- .../subscription_forecast.py | 2 +- .../generated_samples/subscription_query.py | 2 +- .../subscription_query_grouping.py | 2 +- .../view_by_resource_group.py | 2 +- ...view_create_or_update_by_resource_group.py | 2 +- .../view_delete_by_resource_group.py | 5 +- .../view_list_by_resource_group.py | 2 +- 201 files changed, 4342 insertions(+), 403 deletions(-) create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_async_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_async_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_account.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_billing_profile.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_reservation_order.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/async/generate_benefit_utilization_summaries_report_by_savings_plan_order.py rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => benefit_utilization_summaries}/savings_plan_billing_account.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => benefit_utilization_summaries}/savings_plan_billing_profile.py (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => benefit_utilization_summaries}/savings_plan_savings_plan_id_monthly.py (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => benefit_utilization_summaries}/savings_plan_savings_plan_order_id_daily.py (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/check_name_availabilityprivatescheduled_action.py (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/check_name_availabilitysharedscheduled_action.py (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actioncreate_or_updateprivate.py (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actioncreate_or_updateshared.py (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actiondeleteprivate.py (91%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actiondeleteshared.py (91%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actiongetprivate.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actiongetshared.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actioninsight_alertcreate_or_updateshared.py (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionsend_nowprivate.py (91%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionsend_nowshared.py (91%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionslist_with_filterprivate.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionslist_with_filtershared.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionslistprivate.py (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{ => scheduled_actions}/scheduled_actionslistshared.py (95%) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json index 3e65182c1b256..54ef83d2ef8f5 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json @@ -1,11 +1,11 @@ { - "commit": "84113e300ebbd2e804f000b73b522ffd8acedd4a", + "commit": "5beac822673a0729373017d941c73043c803ddb6", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.8", + "@autorest/python@6.4.12", "@autorest/modelerfour@4.24.3" ], - "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 --use=@autorest/python@6.4.8 --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.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --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 8087ca9f9c1f3..73793bed9fbca 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-03-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-03-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 0e26e2fa32912..887df177c0cca 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 @@ -22,6 +22,8 @@ DimensionsOperations, ExportsOperations, ForecastOperations, + GenerateBenefitUtilizationSummariesReportAsyncOperations, + GenerateBenefitUtilizationSummariesReportOperations, GenerateCostDetailsReportOperations, GenerateDetailedCostReportOperationResultsOperations, GenerateDetailedCostReportOperationStatusOperations, @@ -45,20 +47,20 @@ 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 generate_benefit_utilization_summaries_report_async: + GenerateBenefitUtilizationSummariesReportAsyncOperations operations + :vartype generate_benefit_utilization_summaries_report_async: + azure.mgmt.costmanagement.operations.GenerateBenefitUtilizationSummariesReportAsyncOperations :ivar exports: ExportsOperations operations :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations :ivar generate_cost_details_report: GenerateCostDetailsReportOperations operations @@ -75,21 +77,29 @@ 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 :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-03-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 +117,20 @@ 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.generate_benefit_utilization_summaries_report_async = ( + GenerateBenefitUtilizationSummariesReportAsyncOperations( + 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,14 +144,16 @@ 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._client, self._config, self._serialize, self._deserialize - ) - self.benefit_recommendations = BenefitRecommendationsOperations( + 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_utilization_summaries = BenefitUtilizationSummariesOperations( + self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize) + self.scheduled_actions = ScheduledActionsOperations( self._client, self._config, self._serialize, self._deserialize ) 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 77f53a3589c67..e5754a47ce68f 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.0" +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 55e6f4190aa56..a7ddd14a13e92 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-03-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-03-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 daa9e01ede331..746d91f42dbe4 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 @@ -22,6 +22,8 @@ DimensionsOperations, ExportsOperations, ForecastOperations, + GenerateBenefitUtilizationSummariesReportAsyncOperations, + GenerateBenefitUtilizationSummariesReportOperations, GenerateCostDetailsReportOperations, GenerateDetailedCostReportOperationResultsOperations, GenerateDetailedCostReportOperationStatusOperations, @@ -45,20 +47,20 @@ 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 generate_benefit_utilization_summaries_report_async: + GenerateBenefitUtilizationSummariesReportAsyncOperations operations + :vartype generate_benefit_utilization_summaries_report_async: + azure.mgmt.costmanagement.aio.operations.GenerateBenefitUtilizationSummariesReportAsyncOperations :ivar exports: ExportsOperations operations :vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations :ivar generate_cost_details_report: GenerateCostDetailsReportOperations operations @@ -75,21 +77,29 @@ 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 :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-03-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 +117,20 @@ 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.generate_benefit_utilization_summaries_report_async = ( + GenerateBenefitUtilizationSummariesReportAsyncOperations( + 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,14 +144,16 @@ 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._client, self._config, self._serialize, self._deserialize - ) - self.benefit_recommendations = BenefitRecommendationsOperations( + 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_utilization_summaries = BenefitUtilizationSummariesOperations( + self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize) + self.scheduled_actions = ScheduledActionsOperations( self._client, self._config, self._serialize, self._deserialize ) 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 ba3f6355c1035..a8a33dc6ab849 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,14 @@ # -------------------------------------------------------------------------- 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 ._generate_benefit_utilization_summaries_report_async_operations import ( + GenerateBenefitUtilizationSummariesReportAsyncOperations, +) from ._exports_operations import ExportsOperations from ._generate_cost_details_report_operations import GenerateCostDetailsReportOperations from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations @@ -22,10 +24,14 @@ 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 ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -33,21 +39,23 @@ __all__ = [ "Operations", + "BenefitRecommendationsOperations", + "BenefitUtilizationSummariesOperations", + "GenerateBenefitUtilizationSummariesReportOperations", + "GenerateBenefitUtilizationSummariesReportAsyncOperations", + "ExportsOperations", + "GenerateCostDetailsReportOperations", + "GenerateDetailedCostReportOperations", + "GenerateDetailedCostReportOperationResultsOperations", + "GenerateDetailedCostReportOperationStatusOperations", "ViewsOperations", "AlertsOperations", "ForecastOperations", "DimensionsOperations", "QueryOperations", "GenerateReservationDetailsReportOperations", - "ExportsOperations", - "GenerateCostDetailsReportOperations", - "GenerateDetailedCostReportOperations", - "GenerateDetailedCostReportOperationResultsOperations", - "GenerateDetailedCostReportOperationStatusOperations", "PriceSheetOperations", "ScheduledActionsOperations", - "BenefitRecommendationsOperations", - "BenefitUtilizationSummariesOperations", ] __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/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py index ce725afb7c31f..aac3086e4d305 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py @@ -6,6 +6,7 @@ # 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 ( @@ -347,7 +348,7 @@ async def dismiss( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DismissAlertPayload") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py index 1c4ec0dc90143..bfa77ebf03d9e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py @@ -6,6 +6,7 @@ # 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 ( @@ -365,7 +366,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Export") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py index 22f372060e7e0..45ae7f6285bc6 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py @@ -6,6 +6,7 @@ # 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 ( @@ -205,7 +206,7 @@ async def usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ForecastDefinition") @@ -388,7 +389,7 @@ async def external_cloud_provider_usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ForecastDefinition") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_async_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_async_operations.py new file mode 100644 index 0000000000000..107913ea69f4e --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_async_operations.py @@ -0,0 +1,299 @@ +# 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_async_operations import ( + build_generate_by_savings_plan_id_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GenerateBenefitUtilizationSummariesReportAsyncOperations: + """ + .. 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_async` 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_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_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 0000000000000..00a093c40d655 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_benefit_utilization_summaries_report_operations.py @@ -0,0 +1,1251 @@ +# 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_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" + } 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 995aea8d75b57..c889de9271491 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 @@ -6,6 +6,7 @@ # 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 ( @@ -76,7 +77,7 @@ async def _create_operation_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GenerateCostDetailsReportRequestDefinition") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py index cc52ae3dbe9c1..407343cd8e4b8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py @@ -6,6 +6,7 @@ # 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 ( @@ -73,7 +74,7 @@ async def _create_operation_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GenerateDetailedCostReportDefinition") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py index 271b0475eee6c..21f90c26efe10 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py @@ -6,6 +6,7 @@ # 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 ( @@ -179,7 +180,7 @@ async def usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "QueryDefinition") @@ -344,7 +345,7 @@ async def usage_by_external_cloud_provider_type( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "QueryDefinition") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_scheduled_actions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_scheduled_actions_operations.py index e2eae0d9249e5..9adf299e0b72c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_scheduled_actions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_scheduled_actions_operations.py @@ -6,6 +6,7 @@ # 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 @@ -370,7 +371,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(scheduled_action, (IO, bytes)): + if isinstance(scheduled_action, (IOBase, bytes)): _content = scheduled_action else: _json = self._serialize.body(scheduled_action, "ScheduledAction") @@ -688,7 +689,7 @@ async def create_or_update_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(scheduled_action, (IO, bytes)): + if isinstance(scheduled_action, (IOBase, bytes)): _content = scheduled_action else: _json = self._serialize.body(scheduled_action, "ScheduledAction") @@ -1087,7 +1088,7 @@ async def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") @@ -1258,7 +1259,7 @@ async def check_name_availability_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py index bb0b3e8bccd4f..28afc176547a9 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py @@ -6,6 +6,7 @@ # 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 @@ -396,7 +397,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "View") @@ -722,7 +723,7 @@ async def create_or_update_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "View") 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 be704298e8155..e484eedf3311c 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,11 +12,14 @@ 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 @@ -32,9 +35,12 @@ 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 @@ -119,6 +125,7 @@ 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 ChartType from ._cost_management_client_enums import CheckNameAvailabilityReason from ._cost_management_client_enums import CostDetailsDataFormat @@ -176,11 +183,14 @@ "AlertsResult", "AllSavingsBenefitDetails", "AllSavingsList", + "AsyncOperationStatusProperties", "BenefitRecommendationModel", "BenefitRecommendationProperties", "BenefitRecommendationsListResult", "BenefitResource", "BenefitUtilizationSummariesListResult", + "BenefitUtilizationSummariesOperationStatus", + "BenefitUtilizationSummariesRequest", "BenefitUtilizationSummary", "BenefitUtilizationSummaryProperties", "BlobInfo", @@ -196,9 +206,12 @@ "DimensionsListResult", "DismissAlertPayload", "DownloadURL", + "ErrorAdditionalInfo", + "ErrorDetail", "ErrorDetails", "ErrorDetailsWithNestedDetails", "ErrorResponse", + "ErrorResponseAutoGenerated", "ErrorResponseWithNestedDetails", "Export", "ExportDataset", @@ -282,6 +295,7 @@ "AlertTimeGrainType", "AlertType", "BenefitKind", + "BenefitUtilizationSummaryReportSchema", "ChartType", "CheckNameAvailabilityReason", "CostDetailsDataFormat", 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 400e59765fb69..fdb4e24ec48dc 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,23 @@ 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 ChartType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Chart type of the main view in Cost Analysis. Required.""" @@ -199,7 +216,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" @@ -291,7 +310,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 +342,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): @@ -502,7 +522,7 @@ class Term(str, Enum, metaclass=CaseInsensitiveEnumMeta): 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. """ 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 dd5d72143c0ea..001920573331e 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. @@ -1679,13 +1884,84 @@ 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. Variables are only populated by the server, and will be ignored when sending a request. :ivar code: Error code. - :vartype code: int + :vartype code: str :ivar message: Error message indicating why the operation failed. :vartype message: str """ @@ -1696,7 +1972,7 @@ class ErrorDetails(_serialization.Model): } _attribute_map = { - "code": {"key": "code", "type": "int"}, + "code": {"key": "code", "type": "str"}, "message": {"key": "message", "type": "str"}, } @@ -1713,7 +1989,7 @@ class ErrorDetailsWithNestedDetails(ErrorDetails): Variables are only populated by the server, and will be ignored when sending a request. :ivar code: Error code. - :vartype code: int + :vartype code: str :ivar message: Error message indicating why the operation failed. :vartype message: str :ivar details: The additional details of the error. @@ -1727,7 +2003,7 @@ class ErrorDetailsWithNestedDetails(ErrorDetails): } _attribute_map = { - "code": {"key": "code", "type": "int"}, + "code": {"key": "code", "type": "str"}, "message": {"key": "message", "type": "str"}, "details": {"key": "details", "type": "[ErrorDetailsWithNestedDetails]"}, } @@ -1770,6 +2046,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. @@ -3642,7 +3939,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 +3966,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 +4880,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-03-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-03-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 +4895,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-03-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 +4969,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-03-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-03-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 +4984,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-03-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 @@ -5436,8 +5733,6 @@ class View(CostManagementProxyResource): # pylint: disable=too-many-instance-at "name": {"readonly": True}, "type": {"readonly": True}, "created_on": {"readonly": True}, - "modified_on": {"readonly": True}, - "date_range": {"readonly": True}, "currency": {"readonly": True}, } @@ -5470,6 +5765,8 @@ 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, metric: Optional[Union[str, "_models.MetricType"]] = None, @@ -5506,6 +5803,10 @@ 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: "Area", "Line", "StackedColumn", "GroupedColumn", and "Table". :paramtype chart: str or ~azure.mgmt.costmanagement.models.ChartType @@ -5537,8 +5838,8 @@ def __init__( self.display_name = display_name self.scope = scope self.created_on = None - self.modified_on = None - self.date_range = None + self.modified_on = modified_on + self.date_range = date_range self.currency = None self.chart = chart self.accumulated = accumulated 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 ba3f6355c1035..a8a33dc6ab849 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,14 @@ # -------------------------------------------------------------------------- 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 ._generate_benefit_utilization_summaries_report_async_operations import ( + GenerateBenefitUtilizationSummariesReportAsyncOperations, +) from ._exports_operations import ExportsOperations from ._generate_cost_details_report_operations import GenerateCostDetailsReportOperations from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations @@ -22,10 +24,14 @@ 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 ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -33,21 +39,23 @@ __all__ = [ "Operations", + "BenefitRecommendationsOperations", + "BenefitUtilizationSummariesOperations", + "GenerateBenefitUtilizationSummariesReportOperations", + "GenerateBenefitUtilizationSummariesReportAsyncOperations", + "ExportsOperations", + "GenerateCostDetailsReportOperations", + "GenerateDetailedCostReportOperations", + "GenerateDetailedCostReportOperationResultsOperations", + "GenerateDetailedCostReportOperationStatusOperations", "ViewsOperations", "AlertsOperations", "ForecastOperations", "DimensionsOperations", "QueryOperations", "GenerateReservationDetailsReportOperations", - "ExportsOperations", - "GenerateCostDetailsReportOperations", - "GenerateDetailedCostReportOperations", - "GenerateDetailedCostReportOperationResultsOperations", - "GenerateDetailedCostReportOperationStatusOperations", "PriceSheetOperations", "ScheduledActionsOperations", - "BenefitRecommendationsOperations", - "BenefitUtilizationSummariesOperations", ] __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 ccde2d8e4636c..28ea480a1fb1c 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 @@ -6,6 +6,7 @@ # 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 ( @@ -38,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -119,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -456,7 +457,7 @@ def dismiss( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DismissAlertPayload") 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 3503a1d3721e0..b4a03b3e7d5dc 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 3a8af9d968673..e95e025543e78 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 bf471234ed0bc..4abc96802e660 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_by_external_cloud_provider_type_request( # pylint: disable=name-too-long +def build_by_external_cloud_provider_type_request( external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType], external_cloud_provider_id: str, *, @@ -89,7 +89,7 @@ def build_by_external_cloud_provider_type_request( # pylint: disable=name-too-l _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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 e3439e203dadd..a5a98e7c38361 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 @@ -6,6 +6,7 @@ # 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 ( @@ -38,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -119,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -517,7 +518,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Export") 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 adf5dfb5f7565..8e83ff6e65b0a 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 @@ -6,6 +6,7 @@ # 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 ( @@ -38,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -63,7 +64,7 @@ def build_usage_request(scope: str, *, filter: Optional[str] = None, **kwargs: A return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_external_cloud_provider_usage_request( # pylint: disable=name-too-long +def build_external_cloud_provider_usage_request( external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType], external_cloud_provider_id: str, *, @@ -73,7 +74,7 @@ def build_external_cloud_provider_usage_request( # pylint: disable=name-too-lon _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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -278,7 +279,7 @@ def usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ForecastDefinition") @@ -461,7 +462,7 @@ def external_cloud_provider_usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ForecastDefinition") diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_async_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_async_operations.py new file mode 100644 index 0000000000000..09d092ffdd8fc --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_async_operations.py @@ -0,0 +1,333 @@ +# 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, _format_url_section + +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_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-03-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 = _format_url_section(_url, **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 GenerateBenefitUtilizationSummariesReportAsyncOperations: + """ + .. 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_async` 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_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_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 0000000000000..3e188e747cb38 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_benefit_utilization_summaries_report_operations.py @@ -0,0 +1,1404 @@ +# 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, _format_url_section + +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-03-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 = _format_url_section(_url, **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-03-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 = _format_url_section(_url, **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-03-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 = _format_url_section(_url, **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-03-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 = _format_url_section(_url, **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-03-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 = _format_url_section(_url, **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" + } 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 f32c308efeaa7..3f7f1a2f8d073 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 @@ -6,6 +6,7 @@ # 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 ( @@ -40,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -67,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +131,7 @@ def _create_operation_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GenerateCostDetailsReportRequestDefinition") 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 fe9816fc945f4..147422c099ca4 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 35352c8967347..16030dd425dcb 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 e120ec0712110..76be86eb13b25 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 @@ -6,6 +6,7 @@ # 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 ( @@ -40,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -103,7 +104,7 @@ def _create_operation_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GenerateDetailedCostReportDefinition") 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 55c937d03ce86..221eb4ef6f063 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 d227fb63fadc4..afc9178d7276c 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-03-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 c4aaf9989c316..dbf6610846c55 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 @@ -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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,13 +74,13 @@ def build_download_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_download_by_billing_profile_request( # pylint: disable=name-too-long +def build_download_by_billing_profile_request( billing_account_name: str, billing_profile_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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 0aaf01e5cfff3..14fc2ffd5a260 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 @@ -6,6 +6,7 @@ # 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 ( @@ -38,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -61,7 +62,7 @@ def build_usage_request(scope: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_usage_by_external_cloud_provider_type_request( # pylint: disable=name-too-long +def build_usage_by_external_cloud_provider_type_request( external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType], external_cloud_provider_id: str, **kwargs: Any @@ -69,7 +70,7 @@ def build_usage_by_external_cloud_provider_type_request( # pylint: disable=name _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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -246,7 +247,7 @@ def usage( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "QueryDefinition") @@ -411,7 +412,7 @@ def usage_by_external_cloud_provider_type( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "QueryDefinition") 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 a501f34d54599..2eba457fda788 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 @@ -6,6 +6,7 @@ # 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 @@ -40,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -116,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -196,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -313,13 +314,11 @@ def build_check_name_availability_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_check_name_availability_by_scope_request( # pylint: disable=name-too-long - scope: str, **kwargs: Any -) -> HttpRequest: +def build_check_name_availability_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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -663,7 +662,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(scheduled_action, (IO, bytes)): + if isinstance(scheduled_action, (IOBase, bytes)): _content = scheduled_action else: _json = self._serialize.body(scheduled_action, "ScheduledAction") @@ -981,7 +980,7 @@ def create_or_update_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(scheduled_action, (IO, bytes)): + if isinstance(scheduled_action, (IOBase, bytes)): _content = scheduled_action else: _json = self._serialize.body(scheduled_action, "ScheduledAction") @@ -1380,7 +1379,7 @@ def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") @@ -1551,7 +1550,7 @@ def check_name_availability_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") 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 5a8c6fdc4ff24..b0d3d009ea83f 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 @@ -6,6 +6,7 @@ # 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 @@ -40,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,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-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -211,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-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +584,7 @@ def create_or_update(self, view_name: str, parameters: Union[_models.View, IO], content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "View") @@ -909,7 +910,7 @@ def create_or_update_by_scope( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "View") 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 92332e0a8bf22..6b26836d3f677 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-03-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 0000000000000..14584c494a4f8 --- /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-03-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 0000000000000..36ade175b4e69 --- /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-03-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 0000000000000..5250a6214d3f6 --- /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-03-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 0000000000000..19a0dcf0fefc2 --- /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-03-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 0000000000000..e6aac3cd8959e --- /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_async.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-03-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 0000000000000..1bcdcec6c8bc2 --- /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-03-01/examples/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlanOrder.json +if __name__ == "__main__": + main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_account.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_account.py index c098926379451..f9233477bb25b 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_profile.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_billing_profile.py index 83fd2506ae404..570066e81a87a 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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 similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_id_monthly.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_id_monthly.py index a3451662d9a5e..3e49487cd5456 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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 similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_order_id_daily.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_utilization_summaries/savings_plan_savings_plan_order_id_daily.py index 6aa7f30f86ef3..95558e7ce4bf8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-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 b5bb07a533254..d3ba7ba8bbeaf 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-03-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 f0e45e39ad6c0..368f3244fdfea 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-03-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 874fc420c63dd..745a0d07eccd8 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-03-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 02bd4d716cc0d..7aab707f19150 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-03-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 1b4628647f410..9951ae6023d92 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-03-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 a7cae2acc067e..f9c7536e49492 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-03-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 13b762d01fcfe..f6d706ab3913f 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-03-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 e3d0e291e3a4e..424d60f77e6b6 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-03-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 887aafbcf15ef..8e68f5dfd7bc7 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-03-01/examples/BillingProfileForecast.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 5c2a8daab65ea..1a7981ad646f5 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-03-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 88c238b305662..a934c3545bd1b 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-03-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 a384210947022..232ab56a63800 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-03-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 48935633c8ac2..e8d93a12e4fa5 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-03-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 23e65cb1cb0c5..0fa44afd77d47 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-03-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 15b69c4b52006..8027a82d83cc7 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-03-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 f31157b94afd2..104df65e1ecca 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-03-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 36c7d45875f4b..d07bff82c2ffe 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-03-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 face8893712c6..7958b045a2cf3 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-03-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 2da152c2d7782..a3acfc91260b6 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-03-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 1e246acd55bb2..4cc37eca4f8e3 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-03-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 e58b8e1c6003b..d8834dec4117b 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-03-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 d730beedb0a2a..e0151e8698c29 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-03-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 aa40988022373..75e428e104353 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-03-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 a418aca1b8b4b..078f754a5facb 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-03-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 b62acd0963ebb..b325d99749ddc 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-03-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 4a49084d66420..b9a84958eff22 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-03-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 24a9fdabca78c..b75d6758fa9da 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 ae5adf8565d11..d1510460be184 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 259dd8f629173..500e0f769b3af 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 a69690f9e8c2b..6acca4a269cc8 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 c8fa59257795a..20faa1432386a 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 997f926419db9..59e5dffd793ac 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 @@ -60,6 +60,6 @@ def main(): 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-03-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 8b8ca4c5d9435..46099ca88b648 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="providers/Microsoft.Billing/billingAccounts/123456", export_name="TestExport", ) - print(response) -# 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-03-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 13999bc0febcc..ddc24e1d52890 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="providers/Microsoft.Billing/billingAccounts/12/departments/1234", export_name="TestExport", ) - print(response) -# 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-03-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 a98aa17281a10..e98c232b5961d 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", export_name="TestExport", ) - print(response) -# 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-03-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 44aff58c18745..1dc88f1b78b9a 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="providers/Microsoft.Management/managementGroups/TestMG", export_name="TestExport", ) - print(response) -# 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-03-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 def28d98d213a..747a7e899d525 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", export_name="TestExport", ) - print(response) -# 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-03-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 b10f8824b7411..1334b12881d94 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.delete( + client.exports.delete( scope="subscriptions/00000000-0000-0000-0000-000000000000", export_name="TestExport", ) - print(response) -# 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-03-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 8266b9a594d2b..cac5fc8be90c3 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-03-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 e6aa15d5361c8..3b175f63bbebc 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-03-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 4960c604686d4..dabd212ab749d 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-03-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 ac2e541426fc3..c6bef1fe88980 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-03-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 307fb98bd8068..cd1bead88fd59 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-03-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 efbd1e8048b7a..7286b64446447 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-03-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 a63c606016f2c..16e9679b031eb 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="providers/Microsoft.Billing/billingAccounts/123456", export_name="TestExport", ) - print(response) -# 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-03-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 540d70bfb5b36..8e53f817b70e0 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="providers/Microsoft.Billing/billingAccounts/12/departments/1234", export_name="TestExport", ) - print(response) -# 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-03-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 77a3fccda67e4..9793f0bde9538 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", export_name="TestExport", ) - print(response) -# 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-03-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 ab206641adf1d..bbf681d627456 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="providers/Microsoft.Management/managementGroups/TestMG", export_name="TestExport", ) - print(response) -# 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-03-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 27240ad02a342..f0c0f56ff3ece 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", export_name="TestExport", ) - print(response) -# 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-03-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 c73bc6d7f76c2..f8b2130f90461 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.exports.execute( + client.exports.execute( scope="subscriptions/00000000-0000-0000-0000-000000000000", export_name="TestExport", ) - print(response) -# 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-03-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 199740876c6b2..e2733cbec9949 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-03-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 380019a2e8e12..25cc48d81c6e0 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-03-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 79922afbc76dd..26c2880b4ff48 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-03-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 37d279c1cd97d..332a7ca937e60 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-03-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 494201812bf26..e23d1e37fa89a 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-03-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 4565b72e9911c..fac5545dae57d 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-03-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 6562d9dddf918..b99c2f624a173 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-03-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 e5f7c44442771..ee8af6e07f9ce 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-03-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 de0b8d7490a8c..9b3af8af0fa09 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-03-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 8b78725d765d6..3521df5887ca1 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-03-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 b9662dd0ff457..2d62864615c39 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-03-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 37fcdbd45b493..9e651317e231e 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-03-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 779eb2320f80b..b50b43c9ea82f 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-03-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 dc1bb420b118e..0b27be130ce5f 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-03-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 b764fdd3c0eda..061c7348389ef 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-03-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 69b7503274a89..29dd700f3f809 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-03-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 24103f6c65629..2201ef9143fc7 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-03-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 39a6ed464e0fe..37d12b4b22e88 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-03-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 ff8ef5e751648..06f57ca86628f 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-03-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 5879a52304813..9d878cea18347 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-03-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 8fc7ecb2911b9..c8525df203965 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-03-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 3cc8d1ae18e24..09f8c734ad24c 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-03-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 7e38e26e351f9..4df9544894df2 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-03-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 1d9fb4013da79..8161dc3ae481f 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-03-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 b7fd59c2d6f0b..482b880ba1fbc 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-03-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 05857cda0b19b..8b0ddbaba0a0b 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-03-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 fa959fac43175..eea578a543831 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-03-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 6c9aba183fb65..c2c0493910d92 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-03-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 171adc5bea17d..98c56909c6301 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-03-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 66e8751344e39..0ab930da8295d 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-03-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 6b4c1c570c67e..5f039f7f7268a 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-03-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 002c901d4c448..efe671880f502 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-03-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 ad52d818c68e1..b6f3e5ddd79dd 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-03-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 faf3c338f4551..d7323dd22724a 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-03-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 5cbf1f685c89b..1c6a66f96924f 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-03-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 29acfba808509..0a317aef59657 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-03-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 24be92520b5e5..68adab436ae57 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-03-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 5ca0635445f22..e6b0508c41239 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-03-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 a57a6252f33b4..fd7cb4badc402 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-03-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 fd618f059528f..4b2f3e1d6de59 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-03-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 d6624fb9d8581..60b627a03fa39 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-03-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 259ead41ae0ed..f78b04d800fb6 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-03-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 fda6bddcc595a..1a5a3c0a140db 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-03-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 9f7cba047e653..136aed7ae0546 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-03-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 659323eb72963..b96c195ccdd22 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-03-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 0f16db5f30bb6..71e10a3fa01aa 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-03-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 7c8456bba7667..e7ce1abb0c2e1 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-03-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 3e3dffe50f130..5a26817a0a4ac 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-03-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 f4b4e44b51d16..25540effe1003 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-03-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 801c2ef433175..4d5fcb37d5704 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-03-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 ed2286ccfe724..00ff06ad5cb33 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-03-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 bd56472dcdbb7..068972e2b4ab0 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-03-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 cacb2c21e4d52..8e8b2ca4493b5 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-03-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 16ca7b1798a26..b6cdb3fd2c445 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-03-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 b941fb680e484..988f17349d730 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-03-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 498fb66387df2..23edcc84e6976 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-03-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 4dcb6efde3d46..7bc674f87b734 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-03-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 c4c0ff727c0a6..8625e6ce4e864 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-03-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 11b68a17f4d40..57f155d3de04b 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-03-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 e449f04d320cc..93014b3ed58c1 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-03-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 14b352dfb0987..1e2835ada1544 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-03-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 7a472df6af053..e69ba9978d1ef 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-03-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 2030ca2f13a12..d02cf3342425c 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-03-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 6c325487a5b9a..addf578b89721 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-03-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 2450cd6291504..0a7fcd1da870f 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-03-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 e6a64be2fa83d..79b40190de3a0 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-03-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 506133cc0ef2c..f41cc16af71c4 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-03-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 5b4bfb8a31432..4d451c409f01b 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-03-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 b8691b3f4fb19..46e985b79b58d 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 @@ -28,12 +28,11 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.views.delete( + client.views.delete( view_name="TestView", ) - print(response) -# 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-03-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 ff5ce767ac308..df70f36bbcf7e 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-03-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 4d2c8998f9a0d..33a40cd97bacd 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-03-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 d8c4c9543dc62..edd578993f845 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-03-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 4c7ea0276418e..0ac28e7372d31 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-03-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 e4556d516b5f3..bcbff4a926e7a 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-03-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 1d63d0bafb57e..ece871e7c4f65 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-03-01/examples/ResourceGroupQueryGrouping.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilityprivatescheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilityprivatescheduled_action.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilityprivatescheduled_action.py index 3fe817df9a29e..871d05f94412f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilitysharedscheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilitysharedscheduled_action.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/check_name_availabilitysharedscheduled_action.py index 3527687cfd090..10de23cf0376e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateprivate.py index eccd776b189fe..8c4d4d859b966 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioncreate_or_updateshared.py index 957b8e9f1f5df..0339141d3a39f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py similarity index 91% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py index b9968da9988fc..cf04e3d6c7c55 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteprivate.py @@ -28,12 +28,11 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.scheduled_actions.delete( + client.scheduled_actions.delete( name="monthlyCostByResource", ) - print(response) -# 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-03-01/examples/scheduledActions/scheduledAction-delete-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py similarity index 91% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py index e15ae55c9e380..feae5e7ec6f0a 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiondeleteshared.py @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.scheduled_actions.delete_by_scope( + client.scheduled_actions.delete_by_scope( scope="subscriptions/00000000-0000-0000-0000-000000000000", name="monthlyCostByResource", ) - print(response) -# 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-03-01/examples/scheduledActions/scheduledAction-delete-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetprivate.py index baf04b00199fd..bac15a0d429c1 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledAction-get-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actiongetshared.py index b21a8394b3cf5..a39a9873080de 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledAction-get-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioninsight_alertcreate_or_updateshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioninsight_alertcreate_or_updateshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actioninsight_alertcreate_or_updateshared.py index fa047b3903d5c..68379f54f0e8d 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py similarity index 91% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py index 92eef175aadfa..b346b6581b924 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowprivate.py @@ -28,12 +28,11 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.scheduled_actions.run( + client.scheduled_actions.run( name="monthlyCostByResource", ) - print(response) -# 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-03-01/examples/scheduledActions/scheduledAction-sendNow-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py similarity index 91% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py index 49447cdac0748..d25de3b4f8037 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionsend_nowshared.py @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.scheduled_actions.run_by_scope( + client.scheduled_actions.run_by_scope( scope="subscriptions/00000000-0000-0000-0000-000000000000", name="monthlyCostByResource", ) - print(response) -# 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-03-01/examples/scheduledActions/scheduledAction-sendNow-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filterprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filterprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filterprivate.py index 229644b5997fa..f8b8f7d3c6201 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filtershared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filtershared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslist_with_filtershared.py index 9815805b19a2d..c0d92b8d3f179 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistprivate.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistprivate.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistprivate.py index 7e1bb07a89f8f..00f6151126236 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledActions-list-private.json if __name__ == "__main__": main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistshared.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistshared.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions/scheduled_actionslistshared.py index 1ce7057cf63cc..b0f34e560c95c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/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-03-01/examples/scheduledActions/scheduledActions-list-shared.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 9d9f5742c791e..e6d0647d38a90 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-03-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 3a504fe6fdb20..81ee0ddaa6e30 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-03-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 3402e29b0f725..d46ed96574aeb 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-03-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 7c82f57ea2ff1..12e63d7e3c971 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-03-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 63c6ba54de7c6..5711fe5f8b0a2 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-03-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 a80a9cb721c82..3e48ec9b072c6 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-03-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 90f56b4f701ec..5dc7989af24d3 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-03-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 8ebf3ed7deec9..0c0fab542bd1a 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-03-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 0c0f6a148b5b5..cdea60d7da0ee 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-03-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 f4c370b8b313a..8cbed941aa7e9 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 @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.views.delete_by_scope( + client.views.delete_by_scope( scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", view_name="TestView", ) - print(response) -# 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-03-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 13608bc5eb008..9a5dc63084cb4 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-03-01/examples/ViewListByResourceGroup.json if __name__ == "__main__": main()