From 459aaf3a1d58c72950be31f6b50776017a20a566 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Jan 2023 02:43:42 +0000 Subject: [PATCH] CodeGen from PR 22230 in Azure/azure-rest-api-specs Update description for property eTag (#22230) * Update description for property eTag * Switch to If-Match header approach --- .../azure-mgmt-costmanagement/_meta.json | 6 +- .../azure/mgmt/costmanagement/__init__.py | 2 +- .../mgmt/costmanagement/_configuration.py | 15 +- .../costmanagement/_cost_management_client.py | 26 +- .../mgmt/costmanagement/_serialization.py | 174 ++++--- .../azure/mgmt/costmanagement/_vendor.py | 5 +- .../azure/mgmt/costmanagement/_version.py | 2 +- .../azure/mgmt/costmanagement/aio/__init__.py | 2 +- .../mgmt/costmanagement/aio/_configuration.py | 10 +- .../aio/_cost_management_client.py | 17 +- .../costmanagement/aio/operations/__init__.py | 2 +- .../aio/operations/_alerts_operations.py | 52 +- .../_benefit_recommendations_operations.py | 16 +- ...enefit_utilization_summaries_operations.py | 72 +-- .../aio/operations/_dimensions_operations.py | 34 +- .../aio/operations/_exports_operations.py | 80 +-- .../aio/operations/_forecast_operations.py | 30 +- ...generate_cost_details_report_operations.py | 74 +-- ...ost_report_operation_results_operations.py | 30 +- ...cost_report_operation_status_operations.py | 12 +- ...enerate_detailed_cost_report_operations.py | 38 +- ...e_reservation_details_report_operations.py | 72 +-- .../aio/operations/_operations.py | 16 +- .../aio/operations/_price_sheet_operations.py | 72 +-- .../aio/operations/_query_operations.py | 30 +- .../_scheduled_actions_operations.py | 200 ++++---- .../aio/operations/_views_operations.py | 116 ++--- .../mgmt/costmanagement/models/__init__.py | 8 +- .../models/_cost_management_client_enums.py | 75 ++- .../mgmt/costmanagement/models/_models_py3.py | 484 +++++++++++------- .../costmanagement/operations/__init__.py | 2 +- .../operations/_alerts_operations.py | 70 +-- .../_benefit_recommendations_operations.py | 20 +- ...enefit_utilization_summaries_operations.py | 88 ++-- .../operations/_dimensions_operations.py | 42 +- .../operations/_exports_operations.py | 106 ++-- .../operations/_forecast_operations.py | 42 +- ...generate_cost_details_report_operations.py | 84 +-- ...ost_report_operation_results_operations.py | 34 +- ...cost_report_operation_status_operations.py | 16 +- ...enerate_detailed_cost_report_operations.py | 44 +- ...e_reservation_details_report_operations.py | 80 +-- .../costmanagement/operations/_operations.py | 18 +- .../operations/_price_sheet_operations.py | 80 +-- .../operations/_query_operations.py | 42 +- .../_scheduled_actions_operations.py | 262 +++++----- .../operations/_views_operations.py | 150 +++--- ...fit_recommendations_by_billing_account.py} | 2 +- ....py => billing_account_dimensions_list.py} | 2 +- ...account_dimensions_list_expand_and_top.py} | 2 +- ...ng_account_dimensions_list_with_filter.py} | 2 +- ...ery_legacy.py => billing_account_query.py} | 2 +- ...y.py => billing_account_query_grouping.py} | 2 +- ...me_availabilityprivatescheduled_action.py} | 2 +- ...ame_availabilitysharedscheduled_action.py} | 2 +- ...peration_results_by_subscription_scope.py} | 2 +- ...egacy.py => department_dimensions_list.py} | 2 +- ...artment_dimensions_list_expand_and_top.py} | 2 +- ...department_dimensions_list_with_filter.py} | 2 +- ...nt_query_legacy.py => department_query.py} | 2 +- ...legacy.py => department_query_grouping.py} | 2 +- ...ts.py => dismiss_resource_group_alerts.py} | 2 +- ...erts.py => dismiss_subscription_alerts.py} | 2 +- ... => enrollment_account_dimensions_list.py} | 2 +- ...account_dimensions_list_expand_and_top.py} | 2 +- ...nt_account_dimensions_list_with_filter.py} | 2 +- ..._legacy.py => enrollment_account_query.py} | 2 +- ...y => enrollment_account_query_grouping.py} | 2 +- ...> external_billing_accounts_dimensions.py} | 2 +- ....py => external_billing_accounts_query.py} | 2 +- ...y => external_subscriptions_dimensions.py} | 2 +- ...operation_results_by_subscription_scope.py | 40 ++ ...operation_status_by_subscription_scope.py} | 2 +- ...tion_details_report_by_billing_account.py} | 2 +- ...ation_details_report_by_billing_profile.py | 42 ++ ...py => management_group_dimensions_list.py} | 2 +- ...t_group_dimensions_list_expand_and_top.py} | 2 +- ...ment_group_dimensions_list_with_filter.py} | 2 +- ...ry_legacy.py => management_group_query.py} | 2 +- ....py => management_group_query_grouping.py} | 2 +- ...=> mca_billing_account_dimensions_list.py} | 2 +- ...account_dimensions_list_expand_and_top.py} | 2 +- ...ng_account_dimensions_list_with_filter.py} | 2 +- ...ry_mca.py => 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 +- ...ng_profile_dimensions_list_with_filter.py} | 2 +- ...ry_mca.py => mca_billing_profile_query.py} | 2 +- ... => mca_billing_profile_query_grouping.py} | 2 +- ...mca.py => mca_customer_dimensions_list.py} | 2 +- ...ustomer_dimensions_list_expand_and_top.py} | 2 +- ...a_customer_dimensions_list_with_filter.py} | 2 +- ...mer_query_mca.py => mca_customer_query.py} | 2 +- ..._mca.py => mca_customer_query_grouping.py} | 2 +- ...=> mca_invoice_section_dimensions_list.py} | 2 +- ...section_dimensions_list_expand_and_top.py} | 2 +- ...ce_section_dimensions_list_with_filter.py} | 2 +- ...ry_mca.py => mca_invoice_section_query.py} | 2 +- ... => mca_invoice_section_query_grouping.py} | 2 +- ...ew.py => private_view_create_or_update.py} | 2 +- ...private_view.py => private_view_delete.py} | 2 +- ...y.py => resource_group_dimensions_list.py} | 2 +- ...uery_legacy.py => resource_group_query.py} | 2 +- ...cy.py => resource_group_query_grouping.py} | 2 +- ...unt.py => savings_plan_billing_account.py} | 2 +- ...ile.py => savings_plan_billing_profile.py} | 2 +- ...> savings_plan_savings_plan_id_monthly.py} | 2 +- ...vings_plan_savings_plan_order_id_daily.py} | 2 +- ...cheduled_actioncreate_or_updateprivate.py} | 2 +- ...scheduled_actioncreate_or_updateshared.py} | 2 +- ...te.py => scheduled_actiondeleteprivate.py} | 2 +- ...ope.py => scheduled_actiondeleteshared.py} | 2 +- ...ction.py => scheduled_actiongetprivate.py} | 2 +- ..._scope.py => scheduled_actiongetshared.py} | 2 +- ...ioninsight_alertcreate_or_updateshared.py} | 2 +- ....py => scheduled_actionsend_nowprivate.py} | 2 +- ...e.py => scheduled_actionsend_nowshared.py} | 2 +- ...heduled_actionslist_with_filterprivate.py} | 2 +- ...cheduled_actionslist_with_filtershared.py} | 2 +- ...ist.py => scheduled_actionslistprivate.py} | 2 +- ...cope.py => scheduled_actionslistshared.py} | 2 +- ...erts.py => single_resource_group_alert.py} | 2 +- ...alerts.py => single_subscription_alert.py} | 2 +- ...acy.py => subscription_dimensions_list.py} | 2 +- ..._query_legacy.py => subscription_query.py} | 2 +- ...gacy.py => subscription_query_grouping.py} | 2 +- ...roup_view.py => view_by_resource_group.py} | 2 +- ...iew_create_or_update_by_resource_group.py} | 2 +- ...ew.py => view_delete_by_resource_group.py} | 2 +- ...list.py => view_list_by_resource_group.py} | 2 +- 131 files changed, 1774 insertions(+), 1424 deletions(-) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{benefit_recommendations_billing_account_list.py => benefit_recommendations_by_billing_account.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_legacy.py => billing_account_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_expand_and_top_legacy.py => billing_account_dimensions_list_expand_and_top.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_with_filter_legacy.py => billing_account_dimensions_list_with_filter.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_query_legacy.py => billing_account_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_query_grouping_legacy.py => billing_account_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_check_name_availability.py => check_name_availabilityprivatescheduled_action.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_check_name_availability_by_scope.py => check_name_availabilitysharedscheduled_action.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{get_details_of_the_operation_result.py => cost_details_operation_results_by_subscription_scope.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{department_dimensions_list_legacy.py => department_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{department_dimensions_list_expand_and_top_legacy.py => department_dimensions_list_expand_and_top.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{department_dimensions_list_with_filter_legacy.py => department_dimensions_list_with_filter.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{department_query_legacy.py => department_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{department_query_grouping_legacy.py => department_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{patch_resource_group_alerts.py => dismiss_resource_group_alerts.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{patch_subscription_alerts.py => dismiss_subscription_alerts.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{enrollment_account_dimensions_list_legacy.py => enrollment_account_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{enrollment_account_dimensions_list_expand_and_top_legacy.py => enrollment_account_dimensions_list_expand_and_top.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{enrollment_account_dimensions_list_with_filter_legacy.py => enrollment_account_dimensions_list_with_filter.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{enrollment_account_query_legacy.py => enrollment_account_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{enrollment_account_query_grouping_legacy.py => enrollment_account_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{external_billing_account_dimension_list.py => external_billing_accounts_dimensions.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{external_billing_account_query_list.py => external_billing_accounts_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{external_subscription_dimension_list.py => external_subscriptions_dimensions.py} (96%) create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{get_details_of_the_operation_status.py => generate_detailed_cost_report_operation_status_by_subscription_scope.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{reservation_details.py => generate_reservation_details_report_by_billing_account.py} (95%) create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{management_group_dimensions_list_legacy.py => management_group_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{management_group_dimensions_list_expand_and_top_legacy.py => management_group_dimensions_list_expand_and_top.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{management_group_dimensions_list_with_filter_legacy.py => management_group_dimensions_list_with_filter.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{management_group_query_legacy.py => management_group_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{management_group_query_grouping_legacy.py => management_group_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_mca.py => mca_billing_account_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_expand_and_top_mca.py => mca_billing_account_dimensions_list_expand_and_top.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_dimensions_list_with_filter_mca.py => mca_billing_account_dimensions_list_with_filter.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_query_mca.py => mca_billing_account_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_account_query_grouping_mca.py => mca_billing_account_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_profile_dimensions_list_mca.py => mca_billing_profile_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_profile_dimensions_list_expand_and_top_mca.py => mca_billing_profile_dimensions_list_expand_and_top.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_profile_dimensions_list_with_filter_mca.py => mca_billing_profile_dimensions_list_with_filter.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_profile_query_mca.py => mca_billing_profile_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{billing_profile_query_grouping_mca.py => mca_billing_profile_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{customer_dimensions_list_mca.py => mca_customer_dimensions_list.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{customer_dimensions_list_expand_and_top_mca.py => mca_customer_dimensions_list_expand_and_top.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{customer_dimensions_list_with_filter_mca.py => mca_customer_dimensions_list_with_filter.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{customer_query_mca.py => mca_customer_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{customer_query_grouping_mca.py => mca_customer_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{invoice_section_dimensions_list_mca.py => mca_invoice_section_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{invoice_section_dimensions_list_expand_and_top_mca.py => mca_invoice_section_dimensions_list_expand_and_top.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{invoice_section_dimensions_list_with_filter_mca.py => mca_invoice_section_dimensions_list_with_filter.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{invoice_section_query_mca.py => mca_invoice_section_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{invoice_section_query_grouping_mca.py => mca_invoice_section_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{create_or_update_private_view.py => private_view_create_or_update.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{delete_private_view.py => private_view_delete.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_dimensions_list_legacy.py => resource_group_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_query_legacy.py => resource_group_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_query_grouping_legacy.py => resource_group_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{savings_plan_utilization_summaries_billing_account.py => savings_plan_billing_account.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{savings_plan_utilization_summaries_billing_profile.py => savings_plan_billing_profile.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{savings_plan_utilization_summaries_monthly_with_savings_plan_id.py => savings_plan_savings_plan_id_monthly.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{savings_plan_utilization_summaries_daily.py => savings_plan_savings_plan_order_id_daily.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{create_or_update_private_scheduled_action.py => scheduled_actioncreate_or_updateprivate.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{create_or_update_scheduled_action_by_scope.py => scheduled_actioncreate_or_updateshared.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{private_scheduled_action_delete.py => scheduled_actiondeleteprivate.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_delete_by_scope.py => scheduled_actiondeleteshared.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{private_scheduled_action.py => scheduled_actiongetprivate.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_by_scope.py => scheduled_actiongetshared.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{create_or_update_insight_alert_scheduled_action_by_scope.py => scheduled_actioninsight_alertcreate_or_updateshared.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_send_now.py => scheduled_actionsend_nowprivate.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_action_run_by_scope.py => scheduled_actionsend_nowshared.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{private_scheduled_actions_list_filter_by_view_id.py => scheduled_actionslist_with_filterprivate.py} (95%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_actions_list_by_scope_filter_by_view_id.py => scheduled_actionslist_with_filtershared.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{private_scheduled_actions_list.py => scheduled_actionslistprivate.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{scheduled_actions_list_by_scope.py => scheduled_actionslistshared.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{single_resource_group_alerts.py => single_resource_group_alert.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{single_subscription_alerts.py => single_subscription_alert.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{subscription_dimensions_list_legacy.py => subscription_dimensions_list.py} (96%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{subscription_query_legacy.py => subscription_query.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{subscription_query_grouping_legacy.py => subscription_query_grouping.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_view.py => view_by_resource_group.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_create_or_update_view.py => view_create_or_update_by_resource_group.py} (98%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_delete_view.py => view_delete_by_resource_group.py} (97%) rename sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/{resource_group_view_list.py => view_list_by_resource_group.py} (97%) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json index f20a7c259f2b..4a642312f770 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json @@ -1,11 +1,11 @@ { - "commit": "e77f2f011a17a05457e14a0e78b10c100337a557", + "commit": "0b3b0612cb4d8f935f4987b9c316eb28a291fcfc", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.16", "@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.2.1 --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.2.16 --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/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py index 8968aa76c748..327688c9882a 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk 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 dabc5c4d4905..071c38524bd9 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import sys -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -33,28 +33,29 @@ 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 + :param if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. Default value is None. + :type if_match: str :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: + def __init__(self, credential: "TokenCredential", if_match: Optional[str] = None, **kwargs: Any) -> None: super(CostManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-10-01") # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", "2022-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential + self.if_match = if_match self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-costmanagement/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) 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 4ba98e38ed43..d6ce25385d4f 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 @@ -7,12 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import CostManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -87,6 +87,9 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor azure.mgmt.costmanagement.operations.BenefitUtilizationSummariesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential + :param if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. Default value is None. + :type if_match: str :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 @@ -97,12 +100,16 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor """ def __init__( - self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any + self, + credential: "TokenCredential", + if_match: Optional[str] = None, + base_url: str = "https://management.azure.com", + **kwargs: Any ) -> None: - self._config = CostManagementClientConfiguration(credential=credential, **kwargs) + self._config = CostManagementClientConfiguration(credential=credential, if_match=if_match, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -161,15 +168,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> CostManagementClient + def __enter__(self) -> "CostManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py index 7c1dedb5133d..f17c068e833e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,23 +38,38 @@ import re import sys import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate - -from typing import Dict, Any, cast, TYPE_CHECKING +import isodate # type: ignore from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] class RawDeserializer: @@ -65,8 +81,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +147,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +174,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +202,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +233,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,12 +290,12 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -290,27 +304,27 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,13 +333,13 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -339,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -387,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -399,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -412,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -453,7 +477,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -521,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -537,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -606,13 +630,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +645,22 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): - unflattened = {k: new_attr} - new_attr = unflattened + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -659,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -675,7 +698,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -780,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -843,7 +868,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +1026,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1164,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1335,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1355,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1416,7 +1442,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1470,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1474,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1489,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1499,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: @@ -1543,7 +1569,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1591,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1773,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1824,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1836,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1852,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1867,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1897,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1912,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1927,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1950,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1986,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py index 3073d7c910a0..e5754a47ce68 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py index b7a880c83975..e631aab7dc99 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk 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 585b86de08bd..b5921b3bdb7a 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 @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import sys -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -33,19 +33,23 @@ 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 + :param if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. Default value is None. + :type if_match: str :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + def __init__(self, credential: "AsyncTokenCredential", if_match: Optional[str] = None, **kwargs: Any) -> None: super(CostManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-10-01") # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", "2022-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential + self.if_match = if_match self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-costmanagement/{}".format(VERSION)) 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 0b26c3c423d1..35218eb4dc12 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 @@ -7,12 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import CostManagementClientConfiguration from .operations import ( @@ -87,6 +87,9 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor 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 if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. Default value is None. + :type if_match: str :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 @@ -97,12 +100,16 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor """ def __init__( - self, credential: "AsyncTokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any + self, + credential: "AsyncTokenCredential", + if_match: Optional[str] = None, + base_url: str = "https://management.azure.com", + **kwargs: Any ) -> None: - self._config = CostManagementClientConfiguration(credential=credential, **kwargs) + self._config = CostManagementClientConfiguration(credential=credential, if_match=if_match, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False 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 2d305a7dc351..ba3f6355c103 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 @@ -28,7 +28,7 @@ from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ 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 c24ac2826010..20472595c1f6 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 @@ -97,10 +97,10 @@ async def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsResult] + ) + cls: ClsType[_models.AlertsResult] = kwargs.pop("cls", None) request = build_list_request( scope=scope, @@ -110,9 +110,9 @@ async def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -130,7 +130,7 @@ async def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: return deserialized - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts"} @distributed_trace_async async def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: @@ -171,10 +171,10 @@ async def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + ) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -185,9 +185,9 @@ async def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,7 +205,7 @@ async def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} @overload async def dismiss( @@ -332,11 +332,11 @@ async def dismiss( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -358,9 +358,9 @@ async def dismiss( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -378,7 +378,7 @@ async def dismiss( return deserialized - dismiss.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + dismiss.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} @distributed_trace_async async def list_external( @@ -415,10 +415,10 @@ async def list_external( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsResult] + ) + cls: ClsType[_models.AlertsResult] = kwargs.pop("cls", None) request = build_list_external_request( external_cloud_provider_type=external_cloud_provider_type, @@ -429,9 +429,9 @@ async def list_external( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -449,4 +449,6 @@ async def list_external( return deserialized - list_external.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts"} # type: ignore + list_external.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts" + } diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_recommendations_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_recommendations_operations.py index 95dfa1cd9532..adf9986a8398 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_recommendations_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_recommendations_operations.py @@ -99,10 +99,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitRecommendationsListResult] + ) + cls: ClsType[_models.BenefitRecommendationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -126,7 +126,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -142,7 +142,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -150,13 +150,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BenefitRecommendationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -170,4 +170,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations"} # type: ignore + list.metadata = {"url": "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations"} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_utilization_summaries_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_utilization_summaries_operations.py index e38164f1b6da..e9b9dfae724b 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_utilization_summaries_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_benefit_utilization_summaries_operations.py @@ -91,10 +91,10 @@ def list_by_billing_account_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,7 +117,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -133,7 +133,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -141,13 +141,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -161,7 +161,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_billing_account_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_billing_account_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_billing_profile_id( @@ -195,10 +197,10 @@ def list_by_billing_profile_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -222,7 +224,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -238,7 +240,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -246,13 +248,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -266,7 +268,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_billing_profile_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_billing_profile_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_savings_plan_order( @@ -295,10 +299,10 @@ def list_by_savings_plan_order( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -321,7 +325,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -337,7 +341,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -345,13 +349,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -365,7 +369,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_savings_plan_order.metadata = {"url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_savings_plan_order.metadata = { + "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_savings_plan_id( @@ -397,10 +403,10 @@ def list_by_savings_plan_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -424,7 +430,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -440,7 +446,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -448,13 +454,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -468,4 +474,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_savings_plan_id.metadata = {"url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_savings_plan_id.metadata = { + "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py index eff1333cb7cd..008cd7756593 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py @@ -109,10 +109,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DimensionsListResult] + ) + cls: ClsType[_models.DimensionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -137,7 +137,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -153,7 +153,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -161,13 +161,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -181,7 +181,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/dimensions"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/dimensions"} @distributed_trace def by_external_cloud_provider_type( @@ -229,10 +229,10 @@ def by_external_cloud_provider_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DimensionsListResult] + ) + cls: ClsType[_models.DimensionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -258,7 +258,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -274,7 +274,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -282,13 +282,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -302,4 +302,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - by_external_cloud_provider_type.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions"} # type: ignore + by_external_cloud_provider_type.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions" + } 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 d8ef0ca18c5b..a1695b500b11 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 @@ -103,10 +103,10 @@ async def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExportListResult] + ) + cls: ClsType[_models.ExportListResult] = kwargs.pop("cls", None) request = build_list_request( scope=scope, @@ -117,9 +117,9 @@ async def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -137,7 +137,7 @@ async def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> return deserialized - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports"} @distributed_trace_async async def get(self, scope: str, export_name: str, expand: Optional[str] = None, **kwargs: Any) -> _models.Export: @@ -182,10 +182,10 @@ async def get(self, scope: str, export_name: str, expand: Optional[str] = None, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Export] + ) + cls: ClsType[_models.Export] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -197,9 +197,9 @@ async def get(self, scope: str, export_name: str, expand: Optional[str] = None, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -217,7 +217,7 @@ async def get(self, scope: str, export_name: str, expand: Optional[str] = None, return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @overload async def create_or_update( @@ -350,11 +350,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Export] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Export] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -376,9 +376,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -396,11 +396,11 @@ async def create_or_update( deserialized = self._deserialize("Export", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -443,10 +443,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( scope=scope, @@ -457,9 +457,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -473,7 +473,7 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @distributed_trace_async async def execute( # pylint: disable=inconsistent-return-statements @@ -516,10 +516,10 @@ async def execute( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( scope=scope, @@ -530,9 +530,9 @@ async def execute( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -546,7 +546,7 @@ async def execute( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - execute.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} # type: ignore + execute.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} @distributed_trace_async async def get_execution_history( @@ -589,10 +589,10 @@ async def get_execution_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExportExecutionListResult] + ) + cls: ClsType[_models.ExportExecutionListResult] = kwargs.pop("cls", None) request = build_get_execution_history_request( scope=scope, @@ -603,9 +603,9 @@ async def get_execution_history( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -623,4 +623,6 @@ async def get_execution_history( return deserialized - get_execution_history.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory"} # type: ignore + get_execution_history.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" + } 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 a84cbc9bac29..9cbe57e3d2fd 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 @@ -194,11 +194,11 @@ async def usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ForecastResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ForecastResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -220,9 +220,9 @@ async def usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,7 +242,7 @@ async def usage( return deserialized - usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/forecast"} # type: ignore + usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/forecast"} @overload async def external_cloud_provider_usage( @@ -369,11 +369,11 @@ async def external_cloud_provider_usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ForecastResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ForecastResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -396,9 +396,9 @@ async def external_cloud_provider_usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -416,4 +416,6 @@ async def external_cloud_provider_usage( return deserialized - external_cloud_provider_usage.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast"} # type: ignore + external_cloud_provider_usage.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + } 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 b494d94e6028..ffd59d977891 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 @@ -74,11 +74,11 @@ async def _create_operation_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CostDetailsOperationResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CostDetailsOperationResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -99,9 +99,9 @@ async def _create_operation_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def _create_operation_initial( return deserialized - _create_operation_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} # type: ignore + _create_operation_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport" + } @overload async def begin_create_operation( @@ -253,16 +255,16 @@ async def begin_create_operation( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CostDetailsOperationResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CostDetailsOperationResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_operation_initial( # type: ignore + raw_result = await self._create_operation_initial( scope=scope, parameters=parameters, api_version=api_version, @@ -281,9 +283,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -295,9 +297,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} # type: ignore + begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} async def _get_operation_results_initial( self, scope: str, operation_id: str, **kwargs: Any @@ -313,10 +315,10 @@ async def _get_operation_results_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CostDetailsOperationResults]] + ) + cls: ClsType[Optional[_models.CostDetailsOperationResults]] = kwargs.pop("cls", None) request = build_get_operation_results_request( scope=scope, @@ -327,9 +329,9 @@ async def _get_operation_results_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -349,7 +351,9 @@ async def _get_operation_results_initial( return deserialized - _get_operation_results_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}"} # type: ignore + _get_operation_results_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + } @distributed_trace_async async def begin_get_operation_results( @@ -380,15 +384,15 @@ async def begin_get_operation_results( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CostDetailsOperationResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.CostDetailsOperationResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._get_operation_results_initial( # type: ignore + raw_result = await self._get_operation_results_initial( scope=scope, operation_id=operation_id, api_version=api_version, @@ -406,9 +410,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -420,6 +424,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_get_operation_results.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}"} # type: ignore + begin_get_operation_results.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + } diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py index 9337dc341ee7..daae3ce345d7 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py @@ -71,10 +71,10 @@ async def _get_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] + ) + cls: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] = kwargs.pop("cls", None) request = build_get_request( operation_id=operation_id, @@ -85,9 +85,9 @@ async def _get_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -107,7 +107,7 @@ async def _get_initial( return deserialized - _get_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + _get_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} @distributed_trace_async async def begin_get( @@ -138,15 +138,15 @@ async def begin_get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.GenerateDetailedCostReportOperationResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._get_initial( # type: ignore + raw_result = await self._get_initial( operation_id=operation_id, scope=scope, api_version=api_version, @@ -164,7 +164,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -176,6 +176,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + begin_get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py index 3bf99479ad16..b0bad8d6af32 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py @@ -83,10 +83,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationStatuses] + ) + cls: ClsType[_models.GenerateDetailedCostReportOperationStatuses] = kwargs.pop("cls", None) request = build_get_request( operation_id=operation_id, @@ -97,9 +97,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -117,4 +117,4 @@ async def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} 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 1ea51c38d877..88f82b6ec668 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 @@ -71,11 +71,11 @@ async def _create_operation_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -96,9 +96,9 @@ async def _create_operation_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def _create_operation_initial( return deserialized - _create_operation_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + _create_operation_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport" + } @overload async def begin_create_operation( @@ -240,16 +242,16 @@ async def begin_create_operation( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateDetailedCostReportOperationResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_operation_initial( # type: ignore + raw_result = await self._create_operation_initial( scope=scope, parameters=parameters, api_version=api_version, @@ -268,9 +270,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -282,6 +284,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py index 20874b3d0edf..948c0c4b2e43 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py @@ -74,10 +74,10 @@ async def _by_billing_account_id_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatus]] + ) + cls: ClsType[Optional[_models.OperationStatus]] = kwargs.pop("cls", None) request = build_by_billing_account_id_request( billing_account_id=billing_account_id, @@ -89,9 +89,9 @@ async def _by_billing_account_id_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -116,7 +116,9 @@ async def _by_billing_account_id_initial( return deserialized - _by_billing_account_id_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + _by_billing_account_id_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } @distributed_trace_async async def begin_by_billing_account_id( @@ -149,15 +151,15 @@ async def begin_by_billing_account_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._by_billing_account_id_initial( # type: ignore + raw_result = await self._by_billing_account_id_initial( billing_account_id=billing_account_id, start_date=start_date, end_date=end_date, @@ -176,9 +178,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -190,9 +192,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_by_billing_account_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + begin_by_billing_account_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } async def _by_billing_profile_id_initial( self, billing_account_id: str, billing_profile_id: str, start_date: str, end_date: str, **kwargs: Any @@ -208,10 +212,10 @@ async def _by_billing_profile_id_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatus]] + ) + cls: ClsType[Optional[_models.OperationStatus]] = kwargs.pop("cls", None) request = build_by_billing_profile_id_request( billing_account_id=billing_account_id, @@ -224,9 +228,9 @@ async def _by_billing_profile_id_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -251,7 +255,9 @@ async def _by_billing_profile_id_initial( return deserialized - _by_billing_profile_id_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + _by_billing_profile_id_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } @distributed_trace_async async def begin_by_billing_profile_id( @@ -286,15 +292,15 @@ async def begin_by_billing_profile_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._by_billing_profile_id_initial( # type: ignore + raw_result = await self._by_billing_profile_id_initial( billing_account_id=billing_account_id, billing_profile_id=billing_profile_id, start_date=start_date, @@ -314,9 +320,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -328,6 +334,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_by_billing_profile_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + begin_by_billing_profile_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py index 6134de06e246..8319885d4542 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py @@ -71,10 +71,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.CostManagementOperation" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -138,4 +138,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/operations"} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_price_sheet_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_price_sheet_operations.py index a9689d030d9a..1d040e07e6f3 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_price_sheet_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_price_sheet_operations.py @@ -71,10 +71,10 @@ async def _download_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DownloadURL]] + ) + cls: ClsType[Optional[_models.DownloadURL]] = kwargs.pop("cls", None) request = build_download_request( billing_account_name=billing_account_name, @@ -86,9 +86,9 @@ async def _download_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -114,7 +114,9 @@ async def _download_initial( return deserialized - _download_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + _download_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } @distributed_trace_async async def begin_download( @@ -145,15 +147,15 @@ async def begin_download( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DownloadURL] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.DownloadURL] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._download_initial( # type: ignore + raw_result = await self._download_initial( billing_account_name=billing_account_name, billing_profile_name=billing_profile_name, invoice_name=invoice_name, @@ -172,9 +174,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -186,9 +188,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_download.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + begin_download.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } async def _download_by_billing_profile_initial( self, billing_account_name: str, billing_profile_name: str, **kwargs: Any @@ -204,10 +208,10 @@ async def _download_by_billing_profile_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DownloadURL]] + ) + cls: ClsType[Optional[_models.DownloadURL]] = kwargs.pop("cls", None) request = build_download_by_billing_profile_request( billing_account_name=billing_account_name, @@ -218,9 +222,9 @@ async def _download_by_billing_profile_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -246,7 +250,9 @@ async def _download_by_billing_profile_initial( return deserialized - _download_by_billing_profile_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + _download_by_billing_profile_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } @distributed_trace_async async def begin_download_by_billing_profile( @@ -278,15 +284,15 @@ async def begin_download_by_billing_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DownloadURL] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.DownloadURL] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._download_by_billing_profile_initial( # type: ignore + raw_result = await self._download_by_billing_profile_initial( billing_account_name=billing_account_name, billing_profile_name=billing_profile_name, api_version=api_version, @@ -304,9 +310,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -318,6 +324,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_download_by_billing_profile.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + begin_download_by_billing_profile.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } 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 da801dee2c07..7cc0b6329ee9 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 @@ -168,11 +168,11 @@ async def usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.QueryResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.QueryResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -193,9 +193,9 @@ async def usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,7 +215,7 @@ async def usage( return deserialized - usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/query"} # type: ignore + usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/query"} @overload async def usage_by_external_cloud_provider_type( @@ -325,11 +325,11 @@ async def usage_by_external_cloud_provider_type( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QueryResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -351,9 +351,9 @@ async def usage_by_external_cloud_provider_type( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -371,4 +371,6 @@ async def usage_by_external_cloud_provider_type( return deserialized - usage_by_external_cloud_provider_type.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query"} # type: ignore + usage_by_external_cloud_provider_type.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + } 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 f46cbd55ddb5..0aeee965059b 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 @@ -87,10 +87,10 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledActionListResult] + ) + cls: ClsType[_models.ScheduledActionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,7 +111,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -127,7 +127,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -135,27 +135,29 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ScheduledActionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponseWithNestedDetails, pipeline_response + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions"} @distributed_trace def list_by_scope( @@ -193,10 +195,10 @@ def list_by_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledActionListResult] + ) + cls: ClsType[_models.ScheduledActionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,7 +220,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -234,7 +236,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,27 +244,29 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ScheduledActionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponseWithNestedDetails, pipeline_response + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions"} # type: ignore + list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions"} @overload async def create_or_update( @@ -337,11 +341,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -353,6 +357,7 @@ async def create_or_update( request = build_create_or_update_request( name=name, + if_match=self._config.if_match, api_version=api_version, content_type=content_type, json=_json, @@ -362,9 +367,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -372,7 +377,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -382,11 +387,11 @@ async def create_or_update( deserialized = self._deserialize("ScheduledAction", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: @@ -410,10 +415,10 @@ async def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) request = build_get_request( name=name, @@ -423,9 +428,9 @@ async def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -433,7 +438,7 @@ async def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScheduledAction", pipeline_response) @@ -443,7 +448,7 @@ async def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: return deserialized - get.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -467,10 +472,10 @@ async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inc _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( name=name, @@ -480,9 +485,9 @@ async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inc params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -490,13 +495,13 @@ async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inc if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + delete.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @overload async def create_or_update_by_scope( @@ -626,11 +631,11 @@ async def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -643,6 +648,7 @@ async def create_or_update_by_scope( request = build_create_or_update_by_scope_request( scope=scope, name=name, + if_match=self._config.if_match, api_version=api_version, content_type=content_type, json=_json, @@ -652,9 +658,9 @@ async def create_or_update_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -662,7 +668,7 @@ async def create_or_update_by_scope( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -672,11 +678,11 @@ async def create_or_update_by_scope( deserialized = self._deserialize("ScheduledAction", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace_async async def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.ScheduledAction: @@ -718,10 +724,10 @@ async def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Sc _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) request = build_get_by_scope_request( scope=scope, @@ -732,9 +738,9 @@ async def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Sc params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -742,7 +748,7 @@ async def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Sc if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScheduledAction", pipeline_response) @@ -752,7 +758,7 @@ async def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Sc return deserialized - get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace_async async def delete_by_scope( # pylint: disable=inconsistent-return-statements @@ -796,10 +802,10 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_scope_request( scope=scope, @@ -810,9 +816,9 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -820,13 +826,13 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace_async async def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -850,10 +856,10 @@ async def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=incons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_request( name=name, @@ -863,9 +869,9 @@ async def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=incons params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -873,13 +879,13 @@ async def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=incons if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - run.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} # type: ignore + run.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} @distributed_trace_async async def run_by_scope( # pylint: disable=inconsistent-return-statements @@ -923,10 +929,10 @@ async def run_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_by_scope_request( scope=scope, @@ -937,9 +943,9 @@ async def run_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -947,13 +953,13 @@ async def run_by_scope( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - run_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} # type: ignore + run_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} @overload async def check_name_availability( @@ -1023,11 +1029,11 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1047,9 +1053,9 @@ async def check_name_availability( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1057,7 +1063,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response) @@ -1067,7 +1073,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/providers/Microsoft.CostManagement/checkNameAvailability"} # type: ignore + check_name_availability.metadata = {"url": "/providers/Microsoft.CostManagement/checkNameAvailability"} @overload async def check_name_availability_by_scope( @@ -1195,11 +1201,11 @@ async def check_name_availability_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1220,9 +1226,9 @@ async def check_name_availability_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1230,7 +1236,7 @@ async def check_name_availability_by_scope( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response) @@ -1240,4 +1246,6 @@ async def check_name_availability_by_scope( return deserialized - check_name_availability_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/checkNameAvailability"} # type: ignore + check_name_availability_by_scope.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/checkNameAvailability" + } 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 783b77477239..e72655640302 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 @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.View"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ViewListResult] + ) + cls: ClsType[_models.ViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,7 +102,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -118,7 +118,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/views"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/views"} @distributed_trace def list_by_scope(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.View"]: @@ -178,10 +178,10 @@ def list_by_scope(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.Vie _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ViewListResult] + ) + cls: ClsType[_models.ViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -202,7 +202,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -218,7 +218,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -226,13 +226,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -246,7 +246,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views"} # type: ignore + list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views"} @distributed_trace_async async def get(self, view_name: str, **kwargs: Any) -> _models.View: @@ -270,10 +270,10 @@ async def get(self, view_name: str, **kwargs: Any) -> _models.View: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + cls: ClsType[_models.View] = kwargs.pop("cls", None) request = build_get_request( view_name=view_name, @@ -283,9 +283,9 @@ async def get(self, view_name: str, **kwargs: Any) -> _models.View: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -303,7 +303,7 @@ async def get(self, view_name: str, **kwargs: Any) -> _models.View: return deserialized - get.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @overload async def create_or_update( @@ -379,11 +379,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.View] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -404,9 +404,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -424,11 +424,11 @@ async def create_or_update( deserialized = self._deserialize("View", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace_async async def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -452,10 +452,10 @@ async def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disabl _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( view_name=view_name, @@ -465,9 +465,9 @@ async def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disabl params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -481,7 +481,7 @@ async def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disabl if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + delete.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace_async async def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _models.View: @@ -523,10 +523,10 @@ async def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + cls: ClsType[_models.View] = kwargs.pop("cls", None) request = build_get_by_scope_request( scope=scope, @@ -537,9 +537,9 @@ async def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _mode params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -557,7 +557,7 @@ async def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _mode return deserialized - get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} @overload async def create_or_update_by_scope( @@ -693,11 +693,11 @@ async def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.View] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -719,9 +719,9 @@ async def create_or_update_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -739,11 +739,11 @@ async def create_or_update_by_scope( deserialized = self._deserialize("View", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace_async async def delete_by_scope( # pylint: disable=inconsistent-return-statements @@ -787,10 +787,10 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_scope_request( scope=scope, @@ -801,9 +801,9 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -817,4 +817,4 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} 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 aade15c2f223..be704298e815 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 @@ -33,7 +33,9 @@ from ._models_py3 import DismissAlertPayload from ._models_py3 import DownloadURL from ._models_py3 import ErrorDetails +from ._models_py3 import ErrorDetailsWithNestedDetails from ._models_py3 import ErrorResponse +from ._models_py3 import ErrorResponseWithNestedDetails from ._models_py3 import Export from ._models_py3 import ExportDataset from ._models_py3 import ExportDatasetConfiguration @@ -149,7 +151,6 @@ from ._cost_management_client_enums import QueryColumnType from ._cost_management_client_enums import QueryOperatorType from ._cost_management_client_enums import RecurrenceType -from ._cost_management_client_enums import ReportConfigColumnType from ._cost_management_client_enums import ReportConfigSortingType from ._cost_management_client_enums import ReportGranularityType from ._cost_management_client_enums import ReportOperationStatusType @@ -165,7 +166,7 @@ from ._cost_management_client_enums import TimeframeType from ._cost_management_client_enums import WeeksOfMonth from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -196,7 +197,9 @@ "DismissAlertPayload", "DownloadURL", "ErrorDetails", + "ErrorDetailsWithNestedDetails", "ErrorResponse", + "ErrorResponseWithNestedDetails", "Export", "ExportDataset", "ExportDatasetConfiguration", @@ -311,7 +314,6 @@ "QueryColumnType", "QueryOperatorType", "RecurrenceType", - "ReportConfigColumnType", "ReportConfigSortingType", "ReportGranularityType", "ReportOperationStatusType", 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 0dbdb4a13835..525862592840 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 @@ -106,12 +106,12 @@ class AlertType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class BenefitKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Kind/type of the benefit.""" - #: Benefit is IncludedQuantity. INCLUDED_QUANTITY = "IncludedQuantity" - #: Benefit is Reservation. + """Benefit is IncludedQuantity.""" RESERVATION = "Reservation" - #: Benefit is SavingsPlan. + """Benefit is Reservation.""" SAVINGS_PLAN = "SavingsPlan" + """Benefit is SavingsPlan.""" class ChartType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -134,28 +134,28 @@ class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CostDetailsDataFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The data format of the report.""" - #: Csv data format. CSV_COST_DETAILS_DATA_FORMAT = "Csv" + """Csv data format.""" class CostDetailsMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the detailed report. By default ActualCost is provided.""" - #: Actual cost data. ACTUAL_COST_COST_DETAILS_METRIC_TYPE = "ActualCost" - #: Amortized cost data. + """Actual cost data.""" AMORTIZED_COST_COST_DETAILS_METRIC_TYPE = "AmortizedCost" + """Amortized cost data.""" class CostDetailsStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the cost details operation.""" - #: Operation is Completed. COMPLETED_COST_DETAILS_STATUS_TYPE = "Completed" - #: Operation is Completed and no cost data found. + """Operation is Completed.""" NO_DATA_FOUND_COST_DETAILS_STATUS_TYPE = "NoDataFound" - #: Operation Failed. + """Operation is Completed and no cost data found.""" FAILED_COST_DETAILS_STATUS_TYPE = "Failed" + """Operation Failed.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -270,23 +270,23 @@ class GenerateDetailedCostReportMetricType(str, Enum, metaclass=CaseInsensitiveE class Grain(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Grain which corresponds to value.""" - #: Hourly grain corresponds to value per hour. HOURLY = "Hourly" - #: Hourly grain corresponds to value per day. + """Hourly grain corresponds to value per hour.""" DAILY = "Daily" - #: Hourly grain corresponds to value per month. + """Hourly grain corresponds to value per day.""" MONTHLY = "Monthly" + """Hourly grain corresponds to value per month.""" class GrainParameter(str, Enum, metaclass=CaseInsensitiveEnumMeta): """GrainParameter.""" - #: Hourly grain corresponds to value per hour. HOURLY = "Hourly" - #: Hourly grain corresponds to value per day. + """Hourly grain corresponds to value per hour.""" DAILY = "Daily" - #: Hourly grain corresponds to value per month. + """Hourly grain corresponds to value per day.""" MONTHLY = "Monthly" + """Hourly grain corresponds to value per month.""" class GranularityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -305,12 +305,12 @@ class KpiType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class LookBackPeriod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The number of days used to look back.""" - #: 7 days used to look back. LAST7_DAYS = "Last7Days" - #: 30 days used to look back. + """7 days used to look back.""" LAST30_DAYS = "Last30Days" - #: 60 days used to look back. + """30 days used to look back.""" LAST60_DAYS = "Last60Days" + """60 days used to look back.""" class MetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -354,10 +354,12 @@ class PivotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class QueryColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the column in the export.""" + """The type of the column in the report.""" - TAG = "Tag" + TAG_KEY = "TagKey" + """The tag associated with the cost data.""" DIMENSION = "Dimension" + """The dimension of cost data.""" class QueryOperatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -375,13 +377,6 @@ class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ANNUALLY = "Annually" -class ReportConfigColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the column in the report.""" - - TAG = "Tag" - DIMENSION = "Dimension" - - class ReportConfigSortingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Direction of sort.""" @@ -449,42 +444,42 @@ class ReservationReportSchema(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ScheduledActionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Kind of the scheduled action.""" - #: Cost analysis data will be emailed. EMAIL = "Email" - #: Cost anomaly information will be emailed. Available only on subscription scope at daily - #: frequency. If no anomaly is detected on the resource, an email won't be sent. + """Cost analysis data will be emailed.""" INSIGHT_ALERT = "InsightAlert" + """Cost anomaly information will be emailed. Available only on subscription scope at daily + #: frequency. If no anomaly is detected on the resource, an email won't be sent.""" class ScheduledActionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of the scheduled action.""" - #: Scheduled action is saved but will not be run. DISABLED = "Disabled" - #: Scheduled action is saved and will be run. + """Scheduled action is saved but will not be run.""" ENABLED = "Enabled" - #: Scheduled action is expired. + """Scheduled action is saved and will be run.""" EXPIRED = "Expired" + """Scheduled action is expired.""" class ScheduleFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Frequency of the schedule.""" - #: Cost analysis data will be emailed every day. DAILY = "Daily" - #: Cost analysis data will be emailed every week. + """Cost analysis data will be emailed every day.""" WEEKLY = "Weekly" - #: Cost analysis data will be emailed every month. + """Cost analysis data will be emailed every week.""" MONTHLY = "Monthly" + """Cost analysis data will be emailed every month.""" class Scope(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Kind of the recommendation scope.""" - #: Single scope recommendation. SINGLE = "Single" - #: Shared scope recommendation. + """Single scope recommendation.""" SHARED = "Shared" + """Shared scope recommendation.""" class StatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -497,10 +492,10 @@ class StatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class Term(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Grain which corresponds to value.""" - #: Benefit term is 1 year. P1_Y = "P1Y" - #: Benefit term is 3 years. + """Benefit term is 1 year.""" P3_Y = "P3Y" + """Benefit term is 3 years.""" class TimeframeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): 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 94017df1f517..885d99ecb221 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 @@ -53,7 +53,7 @@ class CostManagementProxyResource(_serialization.Model): "e_tag": {"key": "eTag", "type": "str"}, } - def __init__(self, *, e_tag: Optional[str] = None, **kwargs): + def __init__(self, *, e_tag: Optional[str] = None, **kwargs: Any) -> None: """ :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. @@ -144,8 +144,8 @@ def __init__( modification_time: Optional[str] = None, status_modification_user_name: Optional[str] = None, status_modification_time: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. @@ -217,8 +217,8 @@ def __init__( type: Optional[Union[str, "_models.AlertType"]] = None, category: Optional[Union[str, "_models.AlertCategory"]] = None, criteria: Optional[Union[str, "_models.AlertCriteria"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: type of alert. Known values are: "Budget", "Invoice", "Credit", "Quota", "General", "xCloud", and "BudgetForecast". @@ -340,8 +340,8 @@ def __init__( enrollment_start_date: Optional[str] = None, enrollment_end_date: Optional[str] = None, invoicing_threshold: Optional[float] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword time_grain_type: Type of timegrain cadence. Known values are: "None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", and "BillingAnnual". @@ -436,7 +436,7 @@ class AlertsResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -498,7 +498,7 @@ class AllSavingsBenefitDetails(_serialization.Model): "wastage_cost": {"key": "wastageCost", "type": "float"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.overage_cost = None @@ -533,7 +533,7 @@ class AllSavingsList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -567,7 +567,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -606,7 +606,7 @@ class BenefitResource(Resource): "kind": {"key": "kind", "type": "str"}, } - def __init__(self, *, kind: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, kind: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword kind: Reservation or SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". @@ -655,8 +655,8 @@ def __init__( *, kind: Optional[Union[str, "_models.BenefitKind"]] = None, properties: Optional["_models.BenefitRecommendationProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword kind: Reservation or SavingsPlan. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". @@ -758,8 +758,8 @@ def __init__( term: Optional[Union[str, "_models.Term"]] = None, commitment_granularity: Optional[Union[str, "_models.Grain"]] = None, recommendation_details: Optional["_models.AllSavingsBenefitDetails"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword look_back_period: The number of days of usage evaluated for computing the recommendations. Known values are: "Last7Days", "Last30Days", and "Last60Days". @@ -789,7 +789,7 @@ def __init__( self.cost_without_benefit = None self.recommendation_details = recommendation_details self.all_recommendation_details = None - self.scope = None # type: Optional[str] + self.scope: Optional[str] = None class BenefitRecommendationsListResult(_serialization.Model): @@ -813,7 +813,7 @@ class BenefitRecommendationsListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -841,7 +841,7 @@ class BenefitUtilizationSummariesListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -892,10 +892,10 @@ class BenefitUtilizationSummary(Resource): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class BenefitUtilizationSummaryProperties(_serialization.Model): @@ -932,7 +932,7 @@ class BenefitUtilizationSummaryProperties(_serialization.Model): "usage_date": {"key": "usageDate", "type": "iso-8601"}, } - def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". @@ -960,7 +960,7 @@ class BlobInfo(_serialization.Model): "byte_count": {"key": "byteCount", "type": "int"}, } - def __init__(self, *, blob_link: Optional[str] = None, byte_count: Optional[int] = None, **kwargs): + def __init__(self, *, blob_link: Optional[str] = None, byte_count: Optional[int] = None, **kwargs: Any) -> None: """ :keyword blob_link: Link to the blob to download file. :paramtype blob_link: str @@ -986,7 +986,7 @@ class CheckNameAvailabilityRequest(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of the resource for which availability needs to be checked. :paramtype name: str @@ -1022,8 +1022,8 @@ def __init__( name_available: Optional[bool] = None, reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None, message: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Indicates if the resource name is available. :paramtype name_available: bool @@ -1087,8 +1087,8 @@ def __init__( format: Optional[Union[str, "_models.FormatType"]] = None, run_history: Optional["_models.ExportExecutionListResult"] = None, partition_data: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword format: The format of the export being delivered. Currently only 'Csv' is supported. "Csv" @@ -1186,8 +1186,8 @@ def __init__( blobs: Optional[List["_models.BlobInfo"]] = None, request_scope: Optional[str] = None, request_body: Optional["_models.GenerateCostDetailsReportRequestDefinition"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The id of the long running operation. :paramtype id: str @@ -1239,7 +1239,8 @@ def __init__( class CostDetailsTimePeriod(_serialization.Model): - """The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months. + """The start and end date for pulling data for the cost detailed report. API only allows data to + be pulled for 1 month or less and no older than 13 months. All required parameters must be populated in order to send to Azure. @@ -1259,7 +1260,7 @@ class CostDetailsTimePeriod(_serialization.Model): "end": {"key": "end", "type": "str"}, } - def __init__(self, *, start: str, end: str, **kwargs): + def __init__(self, *, start: str, end: str, **kwargs: Any) -> None: """ :keyword start: The start date to pull data from. example format 2020-03-15. Required. :paramtype start: str @@ -1308,7 +1309,7 @@ class Operation(_serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.costmanagement.models.OperationDisplay @@ -1362,7 +1363,7 @@ class CostManagementOperation(Operation): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.costmanagement.models.OperationDisplay @@ -1412,7 +1413,7 @@ class CostManagementResource(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1500,7 +1501,7 @@ class Dimension(CostManagementResource): # pylint: disable=too-many-instance-at "next_link": {"key": "properties.nextLink", "type": "str"}, } - def __init__(self, *, data: Optional[List[str]] = None, **kwargs): + def __init__(self, *, data: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword data: Dimension data. :paramtype data: list[str] @@ -1534,7 +1535,7 @@ class DimensionsListResult(_serialization.Model): "value": {"key": "value", "type": "[Dimension]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1596,8 +1597,8 @@ def __init__( modification_time: Optional[str] = None, status_modification_user_name: Optional[str] = None, status_modification_time: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword definition: defines the type of alert. :paramtype definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition @@ -1662,7 +1663,9 @@ class DownloadURL(_serialization.Model): "download_url": {"key": "downloadUrl", "type": "str"}, } - def __init__(self, *, valid_till: Optional[datetime.datetime] = None, download_url: Optional[str] = None, **kwargs): + def __init__( + self, *, valid_till: Optional[datetime.datetime] = None, download_url: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword valid_till: The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. @@ -1697,34 +1700,68 @@ class ErrorDetails(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None self.message = None +class ErrorDetailsWithNestedDetails(ErrorDetails): + """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: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + :ivar details: The additional details of the error. + :vartype details: list[~azure.mgmt.costmanagement.models.ErrorDetails] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "details": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetails]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.details = None + + class ErrorResponse(_serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The + reason is provided in the error message. Some Error responses: * - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the + "x-ms-ratelimit-microsoft.consumption-retry-after" header. * - 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time + specified in the "Retry-After" header. - :ivar error: The details of the error. - :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _attribute_map = { "error": {"key": "error", "type": "ErrorDetails"}, } - def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: """ :keyword error: The details of the error. :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails @@ -1733,6 +1770,38 @@ def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **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. + + Some Error responses: + + + * + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the + "x-ms-ratelimit-microsoft.consumption-retry-after" header. + + * + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time + specified in the "Retry-After" header. + + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetailsWithNestedDetails + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetailsWithNestedDetails"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetailsWithNestedDetails"] = None, **kwargs: Any) -> None: + """ + :keyword error: The details of the error. + :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetailsWithNestedDetails + """ + super().__init__(**kwargs) + self.error = error + + class Export(CostManagementProxyResource): # pylint: disable=too-many-instance-attributes """An export resource. @@ -1798,8 +1867,8 @@ def __init__( run_history: Optional["_models.ExportExecutionListResult"] = None, partition_data: Optional[bool] = None, schedule: Optional["_models.ExportSchedule"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. @@ -1850,8 +1919,8 @@ def __init__( *, granularity: Optional[Union[str, "_models.GranularityType"]] = None, configuration: Optional["_models.ExportDatasetConfiguration"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword granularity: The granularity of rows in the export. Currently only 'Daily' is supported. "Daily" @@ -1865,7 +1934,8 @@ def __init__( class ExportDatasetConfiguration(_serialization.Model): - """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + """The export dataset configuration. Allows columns to be selected for the export. If not provided + then the export will include all available columns. :ivar columns: Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel @@ -1877,7 +1947,7 @@ class ExportDatasetConfiguration(_serialization.Model): "columns": {"key": "columns", "type": "[str]"}, } - def __init__(self, *, columns: Optional[List[str]] = None, **kwargs): + def __init__(self, *, columns: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword columns: Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel @@ -1926,8 +1996,8 @@ def __init__( timeframe: Union[str, "_models.TimeframeType"], time_period: Optional["_models.ExportTimePeriod"] = None, data_set: Optional["_models.ExportDataset"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: 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 @@ -1950,7 +2020,22 @@ def __init__( class ExportDeliveryDestination(_serialization.Model): - """This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ). + """This represents the blob storage account location where exports of costs will be delivered. + There are two ways to configure the destination. The approach recommended for most customers is + to specify the resourceId of the storage account. This requires a one-time registration of the + account's subscription with the Microsoft.CostManagementExports resource provider in order to + give Cost Management services access to the storage. When creating an export in the Azure + portal this registration is performed automatically but API users may need to register the + subscription explicitly (for more information see + https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + ). Another way to configure the destination is available ONLY to Partners with a Microsoft + Partner Agreement plan who are global admins of their billing account. These Partners, instead + of specifying the resourceId of a storage account, can specify the storage account name along + with a SAS token for the account. This allows exports of costs to a storage account in any + tenant. The SAS token should be created for the blob service with Service/Container/Object + resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see + https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + ). All required parameters must be populated in order to send to Azure. @@ -1993,8 +2078,8 @@ def __init__( root_folder_path: Optional[str] = None, sas_token: Optional[str] = None, storage_account: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_id: The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified. @@ -2039,7 +2124,7 @@ class ExportDeliveryInfo(_serialization.Model): "destination": {"key": "destination", "type": "ExportDeliveryDestination"}, } - def __init__(self, *, destination: "_models.ExportDeliveryDestination", **kwargs): + def __init__(self, *, destination: "_models.ExportDeliveryDestination", **kwargs: Any) -> None: """ :keyword destination: Has destination for the export being delivered. Required. :paramtype destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination @@ -2065,7 +2150,7 @@ class ExportExecutionListResult(_serialization.Model): "value": {"key": "value", "type": "[ExportRun]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2088,7 +2173,7 @@ class ExportListResult(_serialization.Model): "value": {"key": "value", "type": "[Export]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2146,8 +2231,8 @@ def __init__( run_history: Optional["_models.ExportExecutionListResult"] = None, partition_data: Optional[bool] = None, schedule: Optional["_models.ExportSchedule"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword format: The format of the export being delivered. Currently only 'Csv' is supported. "Csv" @@ -2196,7 +2281,9 @@ class ExportRecurrencePeriod(_serialization.Model): "to": {"key": "to", "type": "iso-8601"}, } - def __init__(self, *, from_property: datetime.datetime, to: Optional[datetime.datetime] = None, **kwargs): + def __init__( + self, *, from_property: datetime.datetime, to: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: """ :keyword from_property: The start date of recurrence. Required. :paramtype from_property: ~datetime.datetime @@ -2279,8 +2366,8 @@ def __init__( file_name: Optional[str] = None, run_settings: Optional["_models.CommonExportProperties"] = None, error: Optional["_models.ErrorDetails"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. @@ -2345,8 +2432,8 @@ def __init__( status: Optional[Union[str, "_models.StatusType"]] = None, recurrence: Optional[Union[str, "_models.RecurrenceType"]] = None, recurrence_period: Optional["_models.ExportRecurrencePeriod"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of the export's schedule. If 'Inactive', the export's schedule is paused. Known values are: "Active" and "Inactive". @@ -2365,7 +2452,8 @@ def __init__( class ExportTimePeriod(_serialization.Model): - """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + """The date range for data in the export. This should only be specified with timeFrame set to + 'Custom'. The maximum date range is 3 months. All required parameters must be populated in order to send to Azure. @@ -2385,7 +2473,7 @@ class ExportTimePeriod(_serialization.Model): "to": {"key": "to", "type": "iso-8601"}, } - def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs): + def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs: Any) -> None: """ :keyword from_property: The start date for export data. Required. :paramtype from_property: ~datetime.datetime @@ -2408,7 +2496,7 @@ class FileDestination(_serialization.Model): "file_formats": {"key": "fileFormats", "type": "[str]"}, } - def __init__(self, *, file_formats: Optional[List[Union[str, "_models.FileFormat"]]] = None, **kwargs): + def __init__(self, *, file_formats: Optional[List[Union[str, "_models.FileFormat"]]] = None, **kwargs: Any) -> None: """ :keyword file_formats: Destination of the view data. Currently only CSV format is supported. :paramtype file_formats: list[str or ~azure.mgmt.costmanagement.models.FileFormat] @@ -2440,8 +2528,8 @@ class ForecastAggregation(_serialization.Model): } def __init__( - self, *, name: Union[str, "_models.FunctionName"], function: Union[str, "_models.FunctionType"], **kwargs - ): + self, *, name: Union[str, "_models.FunctionName"], function: Union[str, "_models.FunctionType"], **kwargs: Any + ) -> None: """ :keyword name: The name of the column to aggregate. Required. Known values are: "PreTaxCostUSD", "Cost", "CostUSD", and "PreTaxCost". @@ -2468,7 +2556,7 @@ class ForecastColumn(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of column. :paramtype name: str @@ -2505,7 +2593,9 @@ class ForecastComparisonExpression(_serialization.Model): "values": {"key": "values", "type": "[str]"}, } - def __init__(self, *, name: str, operator: Union[str, "_models.ForecastOperatorType"], values: List[str], **kwargs): + def __init__( + self, *, name: str, operator: Union[str, "_models.ForecastOperatorType"], values: List[str], **kwargs: Any + ) -> None: """ :keyword name: The name of the column to use in comparison. Required. :paramtype name: str @@ -2556,8 +2646,8 @@ def __init__( granularity: Optional[Union[str, "_models.GranularityType"]] = None, configuration: Optional["_models.ForecastDatasetConfiguration"] = None, filter: Optional["_models.ForecastFilter"] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword granularity: The granularity of rows in the forecast. "Daily" :paramtype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType @@ -2590,7 +2680,7 @@ class ForecastDatasetConfiguration(_serialization.Model): "columns": {"key": "columns", "type": "[str]"}, } - def __init__(self, *, columns: Optional[List[str]] = None, **kwargs): + def __init__(self, *, columns: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword columns: Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns. @@ -2645,8 +2735,8 @@ def __init__( time_period: Optional["_models.ForecastTimePeriod"] = None, include_actual_cost: Optional[bool] = None, include_fresh_partial_cost: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of the forecast. Required. Known values are: "Usage", "ActualCost", and "AmortizedCost". @@ -2705,8 +2795,8 @@ def __init__( or_property: Optional[List["_models.ForecastFilter"]] = None, dimensions: Optional["_models.ForecastComparisonExpression"] = None, tags: Optional["_models.ForecastComparisonExpression"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword and_property: The logical "AND" expression. Must have at least 2 items. :paramtype and_property: list[~azure.mgmt.costmanagement.models.ForecastFilter] @@ -2780,8 +2870,8 @@ def __init__( next_link: Optional[str] = None, columns: Optional[List["_models.ForecastColumn"]] = None, rows: Optional[List[List[Any]]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link (url) to the next page of results. :paramtype next_link: str @@ -2817,7 +2907,7 @@ class ForecastTimePeriod(_serialization.Model): "to": {"key": "to", "type": "iso-8601"}, } - def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs): + def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs: Any) -> None: """ :keyword from_property: The start date to pull data from. Required. :paramtype from_property: ~datetime.datetime @@ -2830,38 +2920,46 @@ def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, * class GenerateCostDetailsReportErrorResponse(_serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The + reason is provided in the error message. Some Error responses: * - 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member not accepted in the request payload. + 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format + or had an invalid member not accepted in the request payload. * - 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or + billingPeriod. API only allows data to be pulled for either timePeriod or invoiceId or + billingPeriod. Customer should provide only one of these parameters. * - 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + 400 Bad Request - Start date must be after . API only allows data to be pulled no older than + 13 months from now. * - 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be + pulled for 1 month or less. * - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the + "retry-after" header. * - 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time + specified in the "Retry-After" header. - :ivar error: The details of the error. - :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _attribute_map = { "error": {"key": "error", "type": "ErrorDetails"}, } - def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: """ :keyword error: The details of the error. :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails @@ -2910,8 +3008,8 @@ def __init__( time_period: Optional["_models.CostDetailsTimePeriod"] = None, billing_period: Optional[str] = None, invoice_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword metric: The type of the detailed report. By default ActualCost is provided. Known values are: "ActualCost" and "AmortizedCost". @@ -2981,8 +3079,8 @@ def __init__( billing_period: Optional[str] = None, invoice_id: Optional[str] = None, customer_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword metric: The type of the detailed report. By default ActualCost is provided. Known values are: "ActualCost" and "AmortizedCost". @@ -3013,29 +3111,34 @@ def __init__( class GenerateDetailedCostReportErrorResponse(_serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The + reason is provided in the error message. Some Error responses: * - 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead. + 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill + the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature + instead. * - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the + "x-ms-ratelimit-microsoft.consumption-retry-after" header. * - 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time + specified in the "Retry-After" header. - :ivar error: The details of the error. - :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _attribute_map = { "error": {"key": "error", "type": "ErrorDetails"}, } - def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: """ :keyword error: The details of the error. :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails @@ -3086,8 +3189,8 @@ def __init__( type: Optional[str] = None, valid_till: Optional[datetime.datetime] = None, download_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The ARM resource id of the long running operation. :paramtype id: str @@ -3160,8 +3263,8 @@ def __init__( error: Optional["_models.ErrorDetails"] = None, valid_till: Optional[datetime.datetime] = None, download_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The ID of the long running operation. :paramtype id: str @@ -3211,7 +3314,7 @@ class GenerateDetailedCostReportTimePeriod(_serialization.Model): "end": {"key": "end", "type": "str"}, } - def __init__(self, *, start: str, end: str, **kwargs): + def __init__(self, *, start: str, end: str, **kwargs: Any) -> None: """ :keyword start: The start date to pull data from. example format 2020-03-15. Required. :paramtype start: str @@ -3282,14 +3385,14 @@ class IncludedQuantityUtilizationSummary(BenefitUtilizationSummary): "utilization_percentage": {"key": "properties.utilizationPercentage", "type": "float"}, } - def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". :paramtype benefit_type: str or ~azure.mgmt.costmanagement.models.BenefitKind """ super().__init__(**kwargs) - self.kind = "IncludedQuantity" # type: str + self.kind: str = "IncludedQuantity" self.arm_sku_name = None self.benefit_id = None self.benefit_order_id = None @@ -3336,7 +3439,7 @@ class IncludedQuantityUtilizationSummaryProperties(BenefitUtilizationSummaryProp "utilization_percentage": {"key": "utilizationPercentage", "type": "float"}, } - def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". @@ -3369,8 +3472,8 @@ def __init__( type: Optional[Union[str, "_models.KpiType"]] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: KPI type (Forecast, Budget). Known values are: "Forecast" and "Budget". :paramtype type: str or ~azure.mgmt.costmanagement.models.KpiType @@ -3424,8 +3527,8 @@ def __init__( language: Optional[str] = None, message: Optional[str] = None, regional_format: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword to: Array of email addresses. Required. :paramtype to: list[str] @@ -3481,7 +3584,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -3491,7 +3594,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results. + """Result of listing cost management operations. It contains a list of operations and a URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -3512,7 +3616,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3546,8 +3650,8 @@ def __init__( status: Optional[Union[str, "_models.OperationStatusType"]] = None, report_url: Optional[Union[str, "_models.ReservationReportSchema"]] = None, valid_until: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of the long running operation. Known values are: "Running", "Completed", and "Failed". @@ -3581,7 +3685,9 @@ class PivotProperties(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.PivotType"]] = None, name: Optional[str] = None, **kwargs): + def __init__( + self, *, type: Optional[Union[str, "_models.PivotType"]] = None, name: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword type: Data type to show in view. Known values are: "Dimension" and "TagKey". :paramtype type: str or ~azure.mgmt.costmanagement.models.PivotType @@ -3594,7 +3700,8 @@ def __init__(self, *, type: Optional[Union[str, "_models.PivotType"]] = None, na class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -3620,7 +3727,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -3646,7 +3753,7 @@ class QueryAggregation(_serialization.Model): "function": {"key": "function", "type": "str"}, } - def __init__(self, *, name: str, function: Union[str, "_models.FunctionType"], **kwargs): + def __init__(self, *, name: str, function: Union[str, "_models.FunctionType"], **kwargs: Any) -> None: """ :keyword name: The name of the column to aggregate. Required. :paramtype name: str @@ -3672,7 +3779,7 @@ class QueryColumn(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of column. :paramtype name: str @@ -3709,7 +3816,9 @@ class QueryComparisonExpression(_serialization.Model): "values": {"key": "values", "type": "[str]"}, } - def __init__(self, *, name: str, operator: Union[str, "_models.QueryOperatorType"], values: List[str], **kwargs): + def __init__( + self, *, name: str, operator: Union[str, "_models.QueryOperatorType"], values: List[str], **kwargs: Any + ) -> None: """ :keyword name: The name of the column to use in comparison. Required. :paramtype name: str @@ -3764,8 +3873,8 @@ def __init__( aggregation: Optional[Dict[str, "_models.QueryAggregation"]] = None, grouping: Optional[List["_models.QueryGrouping"]] = None, filter: Optional["_models.QueryFilter"] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword granularity: The granularity of rows in the query. "Daily" :paramtype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType @@ -3803,7 +3912,7 @@ class QueryDatasetConfiguration(_serialization.Model): "columns": {"key": "columns", "type": "[str]"}, } - def __init__(self, *, columns: Optional[List[str]] = None, **kwargs): + def __init__(self, *, columns: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword columns: Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. @@ -3851,8 +3960,8 @@ def __init__( timeframe: Union[str, "_models.TimeframeType"], dataset: "_models.QueryDataset", time_period: Optional["_models.QueryTimePeriod"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of the query. Required. Known values are: "Usage", "ActualCost", and "AmortizedCost". @@ -3905,8 +4014,8 @@ def __init__( or_property: Optional[List["_models.QueryFilter"]] = None, dimensions: Optional["_models.QueryComparisonExpression"] = None, tags: Optional["_models.QueryComparisonExpression"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword and_property: The logical "AND" expression. Must have at least 2 items. :paramtype and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] @@ -3929,7 +4038,8 @@ class QueryGrouping(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar type: Has type of the column to group. Required. Known values are: "Tag" and "Dimension". + :ivar type: Has type of the column to group. Required. Known values are: "TagKey" and + "Dimension". :vartype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType :ivar name: The name of the column to group. Required. :vartype name: str @@ -3945,9 +4055,9 @@ class QueryGrouping(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, type: Union[str, "_models.QueryColumnType"], name: str, **kwargs): + def __init__(self, *, type: Union[str, "_models.QueryColumnType"], name: str, **kwargs: Any) -> None: """ - :keyword type: Has type of the column to group. Required. Known values are: "Tag" and + :keyword type: Has type of the column to group. Required. Known values are: "TagKey" and "Dimension". :paramtype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType :keyword name: The name of the column to group. Required. @@ -4014,8 +4124,8 @@ def __init__( next_link: Optional[str] = None, columns: Optional[List["_models.QueryColumn"]] = None, rows: Optional[List[List[Any]]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link (url) to the next page of results. :paramtype next_link: str @@ -4051,7 +4161,7 @@ class QueryTimePeriod(_serialization.Model): "to": {"key": "to", "type": "iso-8601"}, } - def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs): + def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs: Any) -> None: """ :keyword from_property: The start date to pull data from. Required. :paramtype from_property: ~datetime.datetime @@ -4064,7 +4174,8 @@ def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, * class RecommendationUsageDetails(_serialization.Model): - """On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations. + """On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for + computing benefit recommendations. Variables are only populated by the server, and will be ignored when sending a request. @@ -4085,7 +4196,7 @@ class RecommendationUsageDetails(_serialization.Model): "charges": {"key": "charges", "type": "[float]"}, } - def __init__(self, *, usage_grain: Optional[Union[str, "_models.Grain"]] = None, **kwargs): + def __init__(self, *, usage_grain: Optional[Union[str, "_models.Grain"]] = None, **kwargs: Any) -> None: """ :keyword usage_grain: The grain of the usage. Supported values: 'Hourly'. Known values are: "Hourly", "Daily", and "Monthly". @@ -4117,7 +4228,7 @@ class ReportConfigAggregation(_serialization.Model): "function": {"key": "function", "type": "str"}, } - def __init__(self, *, name: str, function: Union[str, "_models.FunctionType"], **kwargs): + def __init__(self, *, name: str, function: Union[str, "_models.FunctionType"], **kwargs: Any) -> None: """ :keyword name: The name of the column to aggregate. Required. :paramtype name: str @@ -4155,7 +4266,9 @@ class ReportConfigComparisonExpression(_serialization.Model): "values": {"key": "values", "type": "[str]"}, } - def __init__(self, *, name: str, operator: Union[str, "_models.OperatorType"], values: List[str], **kwargs): + def __init__( + self, *, name: str, operator: Union[str, "_models.OperatorType"], values: List[str], **kwargs: Any + ) -> None: """ :keyword name: The name of the column to use in comparison. Required. :paramtype name: str @@ -4215,8 +4328,8 @@ def __init__( grouping: Optional[List["_models.ReportConfigGrouping"]] = None, sorting: Optional[List["_models.ReportConfigSorting"]] = None, filter: Optional["_models.ReportConfigFilter"] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword granularity: The granularity of rows in the report. Known values are: "Daily" and "Monthly". @@ -4257,7 +4370,7 @@ class ReportConfigDatasetConfiguration(_serialization.Model): "columns": {"key": "columns", "type": "[str]"}, } - def __init__(self, *, columns: Optional[List[str]] = None, **kwargs): + def __init__(self, *, columns: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword columns: Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns. @@ -4299,8 +4412,8 @@ def __init__( or_property: Optional[List["_models.ReportConfigFilter"]] = None, dimensions: Optional["_models.ReportConfigComparisonExpression"] = None, tags: Optional["_models.ReportConfigComparisonExpression"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword and_property: The logical "AND" expression. Must have at least 2 items. :paramtype and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] @@ -4323,8 +4436,9 @@ class ReportConfigGrouping(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar type: Has type of the column to group. Required. Known values are: "Tag" and "Dimension". - :vartype type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :ivar type: Has type of the column to group. Required. Known values are: "TagKey" and + "Dimension". + :vartype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType :ivar name: The name of the column to group. This version supports subscription lowest possible grain. Required. :vartype name: str @@ -4340,11 +4454,11 @@ class ReportConfigGrouping(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, type: Union[str, "_models.ReportConfigColumnType"], name: str, **kwargs): + def __init__(self, *, type: Union[str, "_models.QueryColumnType"], name: str, **kwargs: Any) -> None: """ - :keyword type: Has type of the column to group. Required. Known values are: "Tag" and + :keyword type: Has type of the column to group. Required. Known values are: "TagKey" and "Dimension". - :paramtype type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :paramtype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType :keyword name: The name of the column to group. This version supports subscription lowest possible grain. Required. :paramtype name: str @@ -4375,8 +4489,8 @@ class ReportConfigSorting(_serialization.Model): } def __init__( - self, *, name: str, direction: Optional[Union[str, "_models.ReportConfigSortingType"]] = None, **kwargs - ): + self, *, name: str, direction: Optional[Union[str, "_models.ReportConfigSortingType"]] = None, **kwargs: Any + ) -> None: """ :keyword direction: Direction of sort. Known values are: "Ascending" and "Descending". :paramtype direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingType @@ -4409,7 +4523,7 @@ class ReportConfigTimePeriod(_serialization.Model): "to": {"key": "to", "type": "iso-8601"}, } - def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs): + def __init__(self, *, from_property: datetime.datetime, to: datetime.datetime, **kwargs: Any) -> None: """ :keyword from_property: The start date to pull data from. Required. :paramtype from_property: ~datetime.datetime @@ -4505,14 +4619,14 @@ class SavingsPlanUtilizationSummary(BenefitUtilizationSummary): # pylint: disab "max_utilization_percentage": {"key": "properties.maxUtilizationPercentage", "type": "float"}, } - def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". :paramtype benefit_type: str or ~azure.mgmt.costmanagement.models.BenefitKind """ super().__init__(**kwargs) - self.kind = "SavingsPlan" # type: str + self.kind: str = "SavingsPlan" self.arm_sku_name = None self.benefit_id = None self.benefit_order_id = None @@ -4586,7 +4700,7 @@ class SavingsPlanUtilizationSummaryProperties(BenefitUtilizationSummaryPropertie "max_utilization_percentage": {"key": "maxUtilizationPercentage", "type": "float"}, } - def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs): + def __init__(self, *, benefit_type: Optional[Union[str, "_models.BenefitKind"]] = None, **kwargs: Any) -> None: """ :keyword benefit_type: The benefit type. Supported values: 'SavingsPlan'. Known values are: "IncludedQuantity", "Reservation", and "SavingsPlan". @@ -4611,7 +4725,9 @@ class ScheduledActionProxyResource(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar e_tag: Resource Etag. + :ivar e_tag: Resource Etag. For update calls, eTag is mandatory. Fetch the resource's eTag by + doing a 'GET' call first and then including the latest eTag as part of the request body or + 'If-Match' header while performing the update. For create calls, eTag is not required. :vartype e_tag: str :ivar kind: Kind of the scheduled action. Known values are: "Email" and "InsightAlert". :vartype kind: str or ~azure.mgmt.costmanagement.models.ScheduledActionKind @@ -4636,7 +4752,7 @@ class ScheduledActionProxyResource(ProxyResource): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, kind: Optional[Union[str, "_models.ScheduledActionKind"]] = None, **kwargs): + def __init__(self, *, kind: Optional[Union[str, "_models.ScheduledActionKind"]] = None, **kwargs: Any) -> None: """ :keyword kind: Kind of the scheduled action. Known values are: "Email" and "InsightAlert". :paramtype kind: str or ~azure.mgmt.costmanagement.models.ScheduledActionKind @@ -4660,7 +4776,9 @@ class ScheduledAction(ScheduledActionProxyResource): # pylint: disable=too-many :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar e_tag: Resource Etag. + :ivar e_tag: Resource Etag. For update calls, eTag is mandatory. Fetch the resource's eTag by + doing a 'GET' call first and then including the latest eTag as part of the request body or + 'If-Match' header while performing the update. For create calls, eTag is not required. :vartype e_tag: str :ivar kind: Kind of the scheduled action. Known values are: "Email" and "InsightAlert". :vartype kind: str or ~azure.mgmt.costmanagement.models.ScheduledActionKind @@ -4739,8 +4857,8 @@ def __init__( scope: Optional[str] = None, status: Optional[Union[str, "_models.ScheduledActionStatus"]] = None, view_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword kind: Kind of the scheduled action. Known values are: "Email" and "InsightAlert". :paramtype kind: str or ~azure.mgmt.costmanagement.models.ScheduledActionKind @@ -4811,7 +4929,7 @@ class ScheduledActionListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4870,8 +4988,8 @@ def __init__( days_of_week: Optional[List[Union[str, "_models.DaysOfWeek"]]] = None, weeks_of_month: Optional[List[Union[str, "_models.WeeksOfMonth"]]] = None, day_of_month: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword frequency: Frequency of the schedule. Required. Known values are: "Daily", "Weekly", and "Monthly". @@ -4985,8 +5103,8 @@ def __init__( term: Optional[Union[str, "_models.Term"]] = None, commitment_granularity: Optional[Union[str, "_models.Grain"]] = None, recommendation_details: Optional["_models.AllSavingsBenefitDetails"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword look_back_period: The number of days of usage evaluated for computing the recommendations. Known values are: "Last7Days", "Last30Days", and "Last60Days". @@ -5011,7 +5129,7 @@ def __init__( recommendation_details=recommendation_details, **kwargs ) - self.scope = "Shared" # type: str + self.scope: str = "Shared" class SingleScopeBenefitRecommendationProperties( @@ -5106,8 +5224,8 @@ def __init__( term: Optional[Union[str, "_models.Term"]] = None, commitment_granularity: Optional[Union[str, "_models.Grain"]] = None, recommendation_details: Optional["_models.AllSavingsBenefitDetails"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword look_back_period: The number of days of usage evaluated for computing the recommendations. Known values are: "Last7Days", "Last30Days", and "Last60Days". @@ -5132,7 +5250,7 @@ def __init__( recommendation_details=recommendation_details, **kwargs ) - self.scope = "Single" # type: str + self.scope: str = "Single" self.subscription_id = None self.resource_group = None @@ -5149,7 +5267,9 @@ class Status(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, *, status: Optional[Union[str, "_models.ReportOperationStatusType"]] = None, **kwargs): + def __init__( + self, *, status: Optional[Union[str, "_models.ReportOperationStatusType"]] = None, **kwargs: Any + ) -> None: """ :keyword status: The status of the long running operation. Known values are: "InProgress", "Completed", "Failed", "Queued", "NoDataFound", "ReadyToDownload", and "TimedOut". @@ -5196,8 +5316,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -5342,8 +5462,8 @@ def __init__( time_period: Optional["_models.ReportConfigTimePeriod"] = None, data_set: Optional["_models.ReportConfigDataset"] = None, include_monetary_commitment: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. @@ -5435,7 +5555,7 @@ class ViewListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None 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 2d305a7dc351..ba3f6355c103 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 @@ -28,7 +28,7 @@ from ._benefit_utilization_summaries_operations import BenefitUtilizationSummariesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ 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 39878262b5b6..ded01765c0bb 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 @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -67,7 +67,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +77,7 @@ def build_get_request(scope: str, alert_id: str, **kwargs: Any) -> HttpRequest: "alertId": _SERIALIZER.url("alert_id", alert_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,8 +92,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_dismiss_request(scope: str, alert_id: str, **kwargs: Any) -> HttpReque "alertId": _SERIALIZER.url("alert_id", alert_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,7 +124,7 @@ def build_list_external_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +139,7 @@ def build_list_external_request( "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,10 +206,10 @@ def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsResult] + ) + cls: ClsType[_models.AlertsResult] = kwargs.pop("cls", None) request = build_list_request( scope=scope, @@ -219,9 +219,9 @@ def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -239,7 +239,7 @@ def list(self, scope: str, **kwargs: Any) -> _models.AlertsResult: return deserialized - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts"} @distributed_trace def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: @@ -280,10 +280,10 @@ def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + ) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -294,9 +294,9 @@ def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -314,7 +314,7 @@ def get(self, scope: str, alert_id: str, **kwargs: Any) -> _models.Alert: return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} @overload def dismiss( @@ -441,11 +441,11 @@ def dismiss( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -467,9 +467,9 @@ def dismiss( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -487,7 +487,7 @@ def dismiss( return deserialized - dismiss.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + dismiss.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} @distributed_trace def list_external( @@ -524,10 +524,10 @@ def list_external( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsResult] + ) + cls: ClsType[_models.AlertsResult] = kwargs.pop("cls", None) request = build_list_external_request( external_cloud_provider_type=external_cloud_provider_type, @@ -538,9 +538,9 @@ def list_external( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -558,4 +558,6 @@ def list_external( return deserialized - list_external.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts"} # type: ignore + list_external.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts" + } 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 62e7f41d301a..46d12fe909ec 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 @@ -52,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request( "billingScope": _SERIALIZER.url("billing_scope", billing_scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -139,10 +139,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitRecommendationsListResult] + ) + cls: ClsType[_models.BenefitRecommendationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -166,7 +166,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -182,7 +182,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -190,13 +190,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BenefitRecommendationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,4 +210,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations"} # type: ignore + list.metadata = {"url": "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations"} 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 4045f0f98ee4..882424c1087e 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 @@ -51,7 +51,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_billing_account_id_request( "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -89,7 +89,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_list_by_billing_profile_id_request( "billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,7 +127,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +139,7 @@ def build_list_by_savings_plan_order_request( "savingsPlanOrderId": _SERIALIZER.url("savings_plan_order_id", savings_plan_order_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,7 +165,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +178,7 @@ def build_list_by_savings_plan_id_request( "savingsPlanId": _SERIALIZER.url("savings_plan_id", savings_plan_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -241,10 +241,10 @@ def list_by_billing_account_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -267,7 +267,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -283,7 +283,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -291,13 +291,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -311,7 +311,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_billing_account_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_billing_account_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_billing_profile_id( @@ -345,10 +347,10 @@ def list_by_billing_profile_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -372,7 +374,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -388,7 +390,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -396,13 +398,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -416,7 +418,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_billing_profile_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_billing_profile_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_savings_plan_order( @@ -445,10 +449,10 @@ def list_by_savings_plan_order( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -471,7 +475,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -487,7 +491,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -495,13 +499,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -515,7 +519,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_savings_plan_order.metadata = {"url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_savings_plan_order.metadata = { + "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } @distributed_trace def list_by_savings_plan_id( @@ -547,10 +553,10 @@ def list_by_savings_plan_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BenefitUtilizationSummariesListResult] + ) + cls: ClsType[_models.BenefitUtilizationSummariesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -574,7 +580,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -590,7 +596,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -598,13 +604,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BenefitUtilizationSummariesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -618,4 +624,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_savings_plan_id.metadata = {"url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries"} # type: ignore + list_by_savings_plan_id.metadata = { + "url": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" + } 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 9a94e4e524e3..f127a2c97388 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 @@ -53,7 +53,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,7 +94,7 @@ def build_by_external_cloud_provider_type_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_by_external_cloud_provider_type_request( "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -199,10 +199,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DimensionsListResult] + ) + cls: ClsType[_models.DimensionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -227,7 +227,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -243,7 +243,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -251,13 +251,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -271,7 +271,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/dimensions"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/dimensions"} @distributed_trace def by_external_cloud_provider_type( @@ -319,10 +319,10 @@ def by_external_cloud_provider_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DimensionsListResult] + ) + cls: ClsType[_models.DimensionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -348,7 +348,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -364,7 +364,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -372,13 +372,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -392,4 +392,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - by_external_cloud_provider_type.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions"} # type: ignore + by_external_cloud_provider_type.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions" + } 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 958ac4bdb38d..a676922547a3 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 @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request(scope: str, *, expand: Optional[str] = None, **kwargs: An "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,7 +79,7 @@ def build_get_request(scope: str, export_name: str, *, expand: Optional[str] = N "exportName": _SERIALIZER.url("export_name", export_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,8 +96,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_create_or_update_request(scope: str, export_name: str, **kwargs: Any) "exportName": _SERIALIZER.url("export_name", export_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,7 +124,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_delete_request(scope: str, export_name: str, **kwargs: Any) -> HttpReq "exportName": _SERIALIZER.url("export_name", export_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,7 +149,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +159,7 @@ def build_execute_request(scope: str, export_name: str, **kwargs: Any) -> HttpRe "exportName": _SERIALIZER.url("export_name", export_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,7 +174,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_get_execution_history_request(scope: str, export_name: str, **kwargs: "exportName": _SERIALIZER.url("export_name", export_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -255,10 +255,10 @@ def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExportListResult] + ) + cls: ClsType[_models.ExportListResult] = kwargs.pop("cls", None) request = build_list_request( scope=scope, @@ -269,9 +269,9 @@ def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> _mode params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -289,7 +289,7 @@ def list(self, scope: str, expand: Optional[str] = None, **kwargs: Any) -> _mode return deserialized - list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports"} @distributed_trace def get(self, scope: str, export_name: str, expand: Optional[str] = None, **kwargs: Any) -> _models.Export: @@ -334,10 +334,10 @@ def get(self, scope: str, export_name: str, expand: Optional[str] = None, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Export] + ) + cls: ClsType[_models.Export] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -349,9 +349,9 @@ def get(self, scope: str, export_name: str, expand: Optional[str] = None, **kwar params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -369,7 +369,7 @@ def get(self, scope: str, export_name: str, expand: Optional[str] = None, **kwar return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @overload def create_or_update( @@ -502,11 +502,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Export] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Export] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -528,9 +528,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -548,11 +548,11 @@ def create_or_update( deserialized = self._deserialize("Export", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -595,10 +595,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( scope=scope, @@ -609,9 +609,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -625,7 +625,7 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + delete.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} @distributed_trace def execute( # pylint: disable=inconsistent-return-statements @@ -668,10 +668,10 @@ def execute( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( scope=scope, @@ -682,9 +682,9 @@ def execute( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -698,7 +698,7 @@ def execute( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - execute.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} # type: ignore + execute.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} @distributed_trace def get_execution_history(self, scope: str, export_name: str, **kwargs: Any) -> _models.ExportExecutionListResult: @@ -739,10 +739,10 @@ def get_execution_history(self, scope: str, export_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExportExecutionListResult] + ) + cls: ClsType[_models.ExportExecutionListResult] = kwargs.pop("cls", None) request = build_get_execution_history_request( scope=scope, @@ -753,9 +753,9 @@ def get_execution_history(self, scope: str, export_name: str, **kwargs: Any) -> params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -773,4 +773,6 @@ def get_execution_history(self, scope: str, export_name: str, **kwargs: Any) -> return deserialized - get_execution_history.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory"} # type: ignore + get_execution_history.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" + } 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 87053c2968cf..783cea2472f5 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 @@ -43,8 +43,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_usage_request(scope: str, *, filter: Optional[str] = None, **kwargs: A "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -78,8 +78,8 @@ def build_external_cloud_provider_usage_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_external_cloud_provider_usage_request( "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -267,11 +267,11 @@ def usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ForecastResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ForecastResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -293,9 +293,9 @@ def usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -315,7 +315,7 @@ def usage( return deserialized - usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/forecast"} # type: ignore + usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/forecast"} @overload def external_cloud_provider_usage( @@ -442,11 +442,11 @@ def external_cloud_provider_usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ForecastResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ForecastResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -469,9 +469,9 @@ def external_cloud_provider_usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -489,4 +489,6 @@ def external_cloud_provider_usage( return deserialized - external_cloud_provider_usage.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast"} # type: ignore + external_cloud_provider_usage.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + } 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 abb85608f83d..2059aa723ad0 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 @@ -45,8 +45,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +55,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -72,7 +72,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_operation_results_request(scope: str, operation_id: str, **kwargs: "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,11 +128,11 @@ def _create_operation_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CostDetailsOperationResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CostDetailsOperationResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -153,9 +153,9 @@ def _create_operation_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -182,7 +182,9 @@ def _create_operation_initial( return deserialized - _create_operation_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} # type: ignore + _create_operation_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport" + } @overload def begin_create_operation( @@ -307,16 +309,16 @@ def begin_create_operation( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CostDetailsOperationResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CostDetailsOperationResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_operation_initial( # type: ignore + raw_result = self._create_operation_initial( scope=scope, parameters=parameters, api_version=api_version, @@ -335,9 +337,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -349,9 +351,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} # type: ignore + begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport"} def _get_operation_results_initial( self, scope: str, operation_id: str, **kwargs: Any @@ -367,10 +369,10 @@ def _get_operation_results_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CostDetailsOperationResults]] + ) + cls: ClsType[Optional[_models.CostDetailsOperationResults]] = kwargs.pop("cls", None) request = build_get_operation_results_request( scope=scope, @@ -381,9 +383,9 @@ def _get_operation_results_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -403,7 +405,9 @@ def _get_operation_results_initial( return deserialized - _get_operation_results_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}"} # type: ignore + _get_operation_results_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + } @distributed_trace def begin_get_operation_results( @@ -434,15 +438,15 @@ def begin_get_operation_results( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CostDetailsOperationResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.CostDetailsOperationResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._get_operation_results_initial( # type: ignore + raw_result = self._get_operation_results_initial( scope=scope, operation_id=operation_id, api_version=api_version, @@ -460,9 +464,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -474,6 +478,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_get_operation_results.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}"} # type: ignore + begin_get_operation_results.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + } 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 0cc2d0a6b70c..e719bf581c57 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 @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +55,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -99,10 +99,10 @@ def _get_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] + ) + cls: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] = kwargs.pop("cls", None) request = build_get_request( operation_id=operation_id, @@ -113,9 +113,9 @@ def _get_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -135,7 +135,7 @@ def _get_initial( return deserialized - _get_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + _get_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} @distributed_trace def begin_get( @@ -166,15 +166,15 @@ def begin_get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.GenerateDetailedCostReportOperationResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._get_initial( # type: ignore + raw_result = self._get_initial( operation_id=operation_id, scope=scope, api_version=api_version, @@ -192,7 +192,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -204,6 +204,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + begin_get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} 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 9e9300779dc7..6cc74ce32cce 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 @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_get_request(operation_id: str, scope: str, **kwargs: Any) -> HttpReque "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,10 +109,10 @@ def get(self, operation_id: str, scope: str, **kwargs: Any) -> _models.GenerateD _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationStatuses] + ) + cls: ClsType[_models.GenerateDetailedCostReportOperationStatuses] = kwargs.pop("cls", None) request = build_get_request( operation_id=operation_id, @@ -123,9 +123,9 @@ def get(self, operation_id: str, scope: str, **kwargs: Any) -> _models.GenerateD params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -143,4 +143,4 @@ def get(self, operation_id: str, scope: str, **kwargs: Any) -> _models.GenerateD return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} 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 d1aa61e8aef0..7640ab9751e9 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 @@ -45,8 +45,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +55,7 @@ def build_create_operation_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,11 +101,11 @@ def _create_operation_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GenerateDetailedCostReportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -126,9 +126,9 @@ def _create_operation_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -161,7 +161,9 @@ def _create_operation_initial( return deserialized - _create_operation_initial.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + _create_operation_initial.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport" + } @overload def begin_create_operation( @@ -270,16 +272,16 @@ def begin_create_operation( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GenerateDetailedCostReportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateDetailedCostReportOperationResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_operation_initial( # type: ignore + raw_result = self._create_operation_initial( scope=scope, parameters=parameters, api_version=api_version, @@ -298,9 +300,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -312,6 +314,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + begin_create_operation.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} 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 fe00d3275649..53d6ef302a89 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 @@ -47,7 +47,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_by_billing_account_id_request( "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["startDate"] = _SERIALIZER.query("start_date", start_date, "str") @@ -78,7 +78,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_by_billing_profile_id_request( "billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["startDate"] = _SERIALIZER.query("start_date", start_date, "str") @@ -137,10 +137,10 @@ def _by_billing_account_id_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatus]] + ) + cls: ClsType[Optional[_models.OperationStatus]] = kwargs.pop("cls", None) request = build_by_billing_account_id_request( billing_account_id=billing_account_id, @@ -152,9 +152,9 @@ def _by_billing_account_id_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -179,7 +179,9 @@ def _by_billing_account_id_initial( return deserialized - _by_billing_account_id_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + _by_billing_account_id_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } @distributed_trace def begin_by_billing_account_id( @@ -212,15 +214,15 @@ def begin_by_billing_account_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._by_billing_account_id_initial( # type: ignore + raw_result = self._by_billing_account_id_initial( billing_account_id=billing_account_id, start_date=start_date, end_date=end_date, @@ -239,9 +241,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -253,9 +255,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_by_billing_account_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + begin_by_billing_account_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } def _by_billing_profile_id_initial( self, billing_account_id: str, billing_profile_id: str, start_date: str, end_date: str, **kwargs: Any @@ -271,10 +275,10 @@ def _by_billing_profile_id_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatus]] + ) + cls: ClsType[Optional[_models.OperationStatus]] = kwargs.pop("cls", None) request = build_by_billing_profile_id_request( billing_account_id=billing_account_id, @@ -287,9 +291,9 @@ def _by_billing_profile_id_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -314,7 +318,9 @@ def _by_billing_profile_id_initial( return deserialized - _by_billing_profile_id_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + _by_billing_profile_id_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } @distributed_trace def begin_by_billing_profile_id( @@ -349,15 +355,15 @@ def begin_by_billing_profile_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._by_billing_profile_id_initial( # type: ignore + raw_result = self._by_billing_profile_id_initial( billing_account_id=billing_account_id, billing_profile_id=billing_profile_id, start_date=start_date, @@ -377,9 +383,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -391,6 +397,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_by_billing_profile_id.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + begin_by_billing_profile_id.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + } 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 35d797e55af8..8050f08459ac 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 @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,10 +92,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.CostManagementOperation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,4 +159,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/operations"} 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 e283527e8af8..20d9bf7ea098 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 @@ -47,7 +47,7 @@ def build_download_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_download_request( "invoiceName": _SERIALIZER.url("invoice_name", invoice_name, "str", pattern=r"[A-Za-z0-9]+"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,7 +85,7 @@ def build_download_by_billing_profile_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_download_by_billing_profile_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,10 +149,10 @@ def _download_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DownloadURL]] + ) + cls: ClsType[Optional[_models.DownloadURL]] = kwargs.pop("cls", None) request = build_download_request( billing_account_name=billing_account_name, @@ -164,9 +164,9 @@ def _download_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,7 +192,9 @@ def _download_initial( return deserialized - _download_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + _download_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } @distributed_trace def begin_download( @@ -223,15 +225,15 @@ def begin_download( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DownloadURL] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.DownloadURL] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._download_initial( # type: ignore + raw_result = self._download_initial( billing_account_name=billing_account_name, billing_profile_name=billing_profile_name, invoice_name=invoice_name, @@ -250,9 +252,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -264,9 +266,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_download.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + begin_download.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } def _download_by_billing_profile_initial( self, billing_account_name: str, billing_profile_name: str, **kwargs: Any @@ -282,10 +286,10 @@ def _download_by_billing_profile_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DownloadURL]] + ) + cls: ClsType[Optional[_models.DownloadURL]] = kwargs.pop("cls", None) request = build_download_by_billing_profile_request( billing_account_name=billing_account_name, @@ -296,9 +300,9 @@ def _download_by_billing_profile_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -324,7 +328,9 @@ def _download_by_billing_profile_initial( return deserialized - _download_by_billing_profile_initial.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + _download_by_billing_profile_initial.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } @distributed_trace def begin_download_by_billing_profile( @@ -356,15 +362,15 @@ def begin_download_by_billing_profile( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DownloadURL] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.DownloadURL] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._download_by_billing_profile_initial( # type: ignore + raw_result = self._download_by_billing_profile_initial( billing_account_name=billing_account_name, billing_profile_name=billing_profile_name, api_version=api_version, @@ -382,9 +388,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -396,6 +402,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_download_by_billing_profile.metadata = {"url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download"} # type: ignore + begin_download_by_billing_profile.metadata = { + "url": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download" + } 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 0941b5681a4a..3e55063436bd 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 @@ -43,8 +43,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_usage_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,8 +74,8 @@ def build_usage_by_external_cloud_provider_type_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_usage_by_external_cloud_provider_type_request( "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,11 +235,11 @@ def usage( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.QueryResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.QueryResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -260,9 +260,9 @@ def usage( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +282,7 @@ def usage( return deserialized - usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/query"} # type: ignore + usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/query"} @overload def usage_by_external_cloud_provider_type( @@ -392,11 +392,11 @@ def usage_by_external_cloud_provider_type( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QueryResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -418,9 +418,9 @@ def usage_by_external_cloud_provider_type( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -438,4 +438,6 @@ def usage_by_external_cloud_provider_type( return deserialized - usage_by_external_cloud_provider_type.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query"} # type: ignore + usage_by_external_cloud_provider_type.metadata = { + "url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + } 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 4287dbd5a343..5be397ccb92c 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 @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +66,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +75,7 @@ def build_list_by_scope_request(scope: str, *, filter: Optional[str] = None, **k "scope": _SERIALIZER.url("scope", scope, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,12 +88,12 @@ def build_list_by_scope_request(scope: str, *, filter: Optional[str] = None, **k return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_create_or_update_request(name: str, *, if_match: Optional[str] = None, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,12 +102,14 @@ def build_create_or_update_request(name: str, **kwargs: Any) -> HttpRequest: "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _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 if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -119,7 +121,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +130,7 @@ def build_get_request(name: str, **kwargs: Any) -> HttpRequest: "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,7 +145,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +154,7 @@ def build_delete_request(name: str, **kwargs: Any) -> HttpRequest: "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,12 +165,14 @@ def build_delete_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequest: +def build_create_or_update_by_scope_request( + scope: str, name: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,12 +182,14 @@ def build_create_or_update_by_scope_request(scope: str, name: str, **kwargs: Any "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _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 if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -195,7 +201,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +211,7 @@ def build_get_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -220,7 +226,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +236,7 @@ def build_delete_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpR "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -245,7 +251,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +260,7 @@ def build_run_request(name: str, **kwargs: Any) -> HttpRequest: "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +275,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +285,7 @@ def build_run_by_scope_request(scope: str, name: str, **kwargs: Any) -> HttpRequ "name": _SERIALIZER.url("name", name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -294,8 +300,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,8 +322,8 @@ def build_check_name_availability_by_scope_request(scope: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -326,7 +332,7 @@ def build_check_name_availability_by_scope_request(scope: str, **kwargs: Any) -> "scope": _SERIALIZER.url("scope", scope, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -373,10 +379,10 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledActionListResult] + ) + cls: ClsType[_models.ScheduledActionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -397,7 +403,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -413,7 +419,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -421,27 +427,29 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ScheduledActionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponseWithNestedDetails, pipeline_response + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions"} @distributed_trace def list_by_scope( @@ -478,10 +486,10 @@ def list_by_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledActionListResult] + ) + cls: ClsType[_models.ScheduledActionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -503,7 +511,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -519,7 +527,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -527,27 +535,29 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ScheduledActionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponseWithNestedDetails, pipeline_response + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions"} # type: ignore + list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions"} @overload def create_or_update( @@ -622,11 +632,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -638,6 +648,7 @@ def create_or_update( request = build_create_or_update_request( name=name, + if_match=self._config.if_match, api_version=api_version, content_type=content_type, json=_json, @@ -647,9 +658,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -657,7 +668,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -667,11 +678,11 @@ def create_or_update( deserialized = self._deserialize("ScheduledAction", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: @@ -695,10 +706,10 @@ def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) request = build_get_request( name=name, @@ -708,9 +719,9 @@ def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -718,7 +729,7 @@ def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScheduledAction", pipeline_response) @@ -728,7 +739,7 @@ def get(self, name: str, **kwargs: Any) -> _models.ScheduledAction: return deserialized - get.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -752,10 +763,10 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( name=name, @@ -765,9 +776,9 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -775,13 +786,13 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + delete.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}"} @overload def create_or_update_by_scope( @@ -911,11 +922,11 @@ def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -928,6 +939,7 @@ def create_or_update_by_scope( request = build_create_or_update_by_scope_request( scope=scope, name=name, + if_match=self._config.if_match, api_version=api_version, content_type=content_type, json=_json, @@ -937,9 +949,9 @@ def create_or_update_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -947,7 +959,7 @@ def create_or_update_by_scope( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -957,11 +969,11 @@ def create_or_update_by_scope( deserialized = self._deserialize("ScheduledAction", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.ScheduledAction: @@ -1003,10 +1015,10 @@ def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Schedule _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduledAction] + ) + cls: ClsType[_models.ScheduledAction] = kwargs.pop("cls", None) request = build_get_by_scope_request( scope=scope, @@ -1017,9 +1029,9 @@ def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Schedule params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1027,7 +1039,7 @@ def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Schedule if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ScheduledAction", pipeline_response) @@ -1037,7 +1049,7 @@ def get_by_scope(self, scope: str, name: str, **kwargs: Any) -> _models.Schedule return deserialized - get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace def delete_by_scope( # pylint: disable=inconsistent-return-statements @@ -1081,10 +1093,10 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_scope_request( scope=scope, @@ -1095,9 +1107,9 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1105,13 +1117,13 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} # type: ignore + delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}"} @distributed_trace def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -1135,10 +1147,10 @@ def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_request( name=name, @@ -1148,9 +1160,9 @@ def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1158,13 +1170,13 @@ def run(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - run.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} # type: ignore + run.metadata = {"url": "/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} @distributed_trace def run_by_scope( # pylint: disable=inconsistent-return-statements @@ -1208,10 +1220,10 @@ def run_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_by_scope_request( scope=scope, @@ -1222,9 +1234,9 @@ def run_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1232,13 +1244,13 @@ def run_by_scope( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - run_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} # type: ignore + run_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute"} @overload def check_name_availability( @@ -1308,11 +1320,11 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1332,9 +1344,9 @@ def check_name_availability( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1342,7 +1354,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response) @@ -1352,7 +1364,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/providers/Microsoft.CostManagement/checkNameAvailability"} # type: ignore + check_name_availability.metadata = {"url": "/providers/Microsoft.CostManagement/checkNameAvailability"} @overload def check_name_availability_by_scope( @@ -1480,11 +1492,11 @@ def check_name_availability_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1505,9 +1517,9 @@ def check_name_availability_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1515,7 +1527,7 @@ def check_name_availability_by_scope( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseWithNestedDetails, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response) @@ -1525,4 +1537,6 @@ def check_name_availability_by_scope( return deserialized - check_name_availability_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/checkNameAvailability"} # type: ignore + check_name_availability_by_scope.metadata = { + "url": "/{scope}/providers/Microsoft.CostManagement/checkNameAvailability" + } 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 598e85f13489..87ed76db1e37 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 @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +88,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request(view_name: str, **kwargs: Any) -> HttpRequest: "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,8 +112,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_create_or_update_request(view_name: str, **kwargs: Any) -> HttpRequest "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -139,7 +139,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_delete_request(view_name: str, **kwargs: Any) -> HttpRequest: "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,7 +163,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_get_by_scope_request(scope: str, view_name: str, **kwargs: Any) -> Htt "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,8 +188,8 @@ 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_create_or_update_by_scope_request(scope: str, view_name: str, **kwargs "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,7 +216,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] + api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_delete_by_scope_request(scope: str, view_name: str, **kwargs: Any) -> "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -268,10 +268,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.View"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ViewListResult] + ) + cls: ClsType[_models.ViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -291,7 +291,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -307,7 +307,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -315,13 +315,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -335,7 +335,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.CostManagement/views"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.CostManagement/views"} @distributed_trace def list_by_scope(self, scope: str, **kwargs: Any) -> Iterable["_models.View"]: @@ -367,10 +367,10 @@ def list_by_scope(self, scope: str, **kwargs: Any) -> Iterable["_models.View"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ViewListResult] + ) + cls: ClsType[_models.ViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -391,7 +391,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -407,7 +407,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -415,13 +415,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -435,7 +435,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views"} # type: ignore + list_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views"} @distributed_trace def get(self, view_name: str, **kwargs: Any) -> _models.View: @@ -459,10 +459,10 @@ def get(self, view_name: str, **kwargs: Any) -> _models.View: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + cls: ClsType[_models.View] = kwargs.pop("cls", None) request = build_get_request( view_name=view_name, @@ -472,9 +472,9 @@ def get(self, view_name: str, **kwargs: Any) -> _models.View: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -492,7 +492,7 @@ def get(self, view_name: str, **kwargs: Any) -> _models.View: return deserialized - get.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @overload def create_or_update( @@ -566,11 +566,11 @@ def create_or_update(self, view_name: str, parameters: Union[_models.View, IO], _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.View] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -591,9 +591,9 @@ def create_or_update(self, view_name: str, parameters: Union[_models.View, IO], params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -611,11 +611,11 @@ def create_or_update(self, view_name: str, parameters: Union[_models.View, IO], deserialized = self._deserialize("View", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + create_or_update.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -639,10 +639,10 @@ def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( view_name=view_name, @@ -652,9 +652,9 @@ def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disable=inco params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -668,7 +668,7 @@ def delete(self, view_name: str, **kwargs: Any) -> None: # pylint: disable=inco if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + delete.metadata = {"url": "/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _models.View: @@ -710,10 +710,10 @@ def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _models.Vie _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + cls: ClsType[_models.View] = kwargs.pop("cls", None) request = build_get_by_scope_request( scope=scope, @@ -724,9 +724,9 @@ def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _models.Vie params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -744,7 +744,7 @@ def get_by_scope(self, scope: str, view_name: str, **kwargs: Any) -> _models.Vie return deserialized - get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + get_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} @overload def create_or_update_by_scope( @@ -880,11 +880,11 @@ def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.View] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.View] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -906,9 +906,9 @@ def create_or_update_by_scope( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -926,11 +926,11 @@ def create_or_update_by_scope( deserialized = self._deserialize("View", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + create_or_update_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} @distributed_trace def delete_by_scope( # pylint: disable=inconsistent-return-statements @@ -974,10 +974,10 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-10-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-10-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_scope_request( scope=scope, @@ -988,9 +988,9 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1004,4 +1004,4 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + delete_by_scope.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_billing_account_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_billing_account_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py index 625abc9640d1..92332e0a8bf2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_billing_account_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/benefit_recommendations_by_billing_account.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python benefit_recommendations_billing_account_list.py + python benefit_recommendations_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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py index 9b783373c3ff..f0e45e39ad6c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_legacy.py + python billing_account_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py index f13c043cc3ab..874fc420c63d 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_expand_and_top_legacy.py + python billing_account_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py index 67b139a555d6..02bd4d716cc0 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_with_filter_legacy.py + python billing_account_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py index 52ab82ffe603..a7cae2acc067 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_query_legacy.py + python billing_account_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py index fbc06c135d76..13b762d01fcf 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_query_grouping_legacy.py + python billing_account_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilityprivatescheduled_action.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilityprivatescheduled_action.py index 8b9234d05831..3fe817df9a29 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilityprivatescheduled_action.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_check_name_availability.py + python check_name_availabilityprivatescheduled_action.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilitysharedscheduled_action.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilitysharedscheduled_action.py index b4143d3fec08..3527687cfd09 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_check_name_availability_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/check_name_availabilitysharedscheduled_action.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_check_name_availability_by_scope.py + python check_name_availabilitysharedscheduled_action.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_result.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_result.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py index ae8aff59026d..5c2a8daab65e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_result.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/cost_details_operation_results_by_subscription_scope.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python get_details_of_the_operation_result.py + python cost_details_operation_results_by_subscription_scope.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py index 8e4903cf4ade..a38421094702 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python department_dimensions_list_legacy.py + python department_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py index 5e642afe4c34..48935633c8ac 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python department_dimensions_list_expand_and_top_legacy.py + python department_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py index 006cc534aea9..23e65cb1cb0c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python department_dimensions_list_with_filter_legacy.py + python department_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py index 90e9f5d78123..f31157b94afd 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python department_query_legacy.py + python department_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py index 749034add892..36c7d45875f4 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/department_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python department_query_grouping_legacy.py + python department_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_resource_group_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_resource_group_alerts.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py index 2ac6755fa379..face8893712c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_resource_group_alerts.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_resource_group_alerts.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python patch_resource_group_alerts.py + python dismiss_resource_group_alerts.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_subscription_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_subscription_alerts.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py index f9c4741ea35b..2da152c2d778 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/patch_subscription_alerts.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/dismiss_subscription_alerts.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python patch_subscription_alerts.py + python dismiss_subscription_alerts.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py index a1e0f832dd55..e58b8e1c6003 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python enrollment_account_dimensions_list_legacy.py + python enrollment_account_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py index 9f185bbf54ea..d730beedb0a2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python enrollment_account_dimensions_list_expand_and_top_legacy.py + python enrollment_account_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py index 0f8601ded405..aa4098802237 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python enrollment_account_dimensions_list_with_filter_legacy.py + python enrollment_account_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py index a050b8d77006..b62acd0963eb 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python enrollment_account_query_legacy.py + python enrollment_account_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py index 1a9a0f056274..4a49084d6642 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/enrollment_account_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python enrollment_account_query_grouping_legacy.py + python enrollment_account_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_dimension_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_dimension_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py index cfd8376e447b..b764fdd3c0ed 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_dimension_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_dimensions.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python external_billing_account_dimension_list.py + python external_billing_accounts_dimensions.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_query_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_query_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py index dd9b1d56b757..69b7503274a8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_account_query_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_billing_accounts_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python external_billing_account_query_list.py + python external_billing_accounts_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_dimension_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_dimension_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py index 82f50d54bc88..ff8ef5e75164 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscription_dimension_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/external_subscriptions_dimensions.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python external_subscription_dimension_list.py + python external_subscriptions_dimensions.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, 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 new file mode 100644 index 000000000000..ad52d818c68e --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_results_by_subscription_scope.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.costmanagement import CostManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-costmanagement +# USAGE + python generate_detailed_cost_report_operation_results_by_subscription_scope.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_detailed_cost_report_operation_results.begin_get( + operation_id="00000000-0000-0000-0000-000000000000", + scope="subscriptions/00000000-0000-0000-0000-000000000000", + ).result() + print(response) + + +# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json +if __name__ == "__main__": + main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_status.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_status.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py index 34a7e2786535..faf3c338f455 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/get_details_of_the_operation_status.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_detailed_cost_report_operation_status_by_subscription_scope.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python get_details_of_the_operation_status.py + python generate_detailed_cost_report_operation_status_by_subscription_scope.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/reservation_details.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/reservation_details.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py index 8fe21d7aa2b8..5cbf1f685c89 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/reservation_details.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_account.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python reservation_details.py + python generate_reservation_details_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, 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 new file mode 100644 index 000000000000..29acfba80850 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/generate_reservation_details_report_by_billing_profile.py @@ -0,0 +1,42 @@ +# 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_reservation_details_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_reservation_details_report.begin_by_billing_profile_id( + billing_account_id="00000000-0000-0000-0000-000000000000", + billing_profile_id="CZSFR-SDFXC-DSDF", + start_date="2020-01-01", + end_date="2020-01-30", + ).result() + print(response) + + +# x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateReservationDetailsReportByBillingProfile.json +if __name__ == "__main__": + main() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py index df07d8a00487..a57a6252f33b 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python management_group_dimensions_list_legacy.py + python management_group_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py index 63ffe448c71a..fd618f059528 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python management_group_dimensions_list_expand_and_top_legacy.py + python management_group_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py index 1ce215fa7568..d6624fb9d858 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python management_group_dimensions_list_with_filter_legacy.py + python management_group_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py index 28fc66ee84cb..259ead41ae0e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python management_group_query_legacy.py + python management_group_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py index c2d9318c5f2a..fda6bddcc595 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/management_group_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python management_group_query_grouping_legacy.py + python management_group_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py index 4a909d49f2c4..9f7cba047e65 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_mca.py + python mca_billing_account_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py index b36c0023b616..659323eb7296 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_expand_and_top_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_expand_and_top_mca.py + python mca_billing_account_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py index 18aa8a51e66e..0f16db5f30bb 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_dimensions_list_with_filter_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_dimensions_list_with_filter_mca.py + python mca_billing_account_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py index 0906ec936fdf..7c8456bba766 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_query_mca.py + python mca_billing_account_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py index bf0c9c6ebcdc..3e3dffe50f13 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_account_query_grouping_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_account_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_account_query_grouping_mca.py + python mca_billing_account_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py index b4551d052232..f4b4e44b51d1 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_profile_dimensions_list_mca.py + python mca_billing_profile_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_expand_and_top_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_expand_and_top_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py index e28d1ab0f174..801c2ef43317 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_expand_and_top_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_profile_dimensions_list_expand_and_top_mca.py + python mca_billing_profile_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_with_filter_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_with_filter_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py index 26cf5ef67fa2..ed2286ccfe72 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_dimensions_list_with_filter_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_profile_dimensions_list_with_filter_mca.py + python mca_billing_profile_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py index 57d7ec2310fa..bd56472dcdbb 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_profile_query_mca.py + python mca_billing_profile_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_grouping_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_grouping_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py index 82459da672fb..cacb2c21e4d5 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/billing_profile_query_grouping_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_billing_profile_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python billing_profile_query_grouping_mca.py + python mca_billing_profile_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py index 473ceb5317fe..16ca7b1798a2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python customer_dimensions_list_mca.py + python mca_customer_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_expand_and_top_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_expand_and_top_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py index 0b9df1f03006..b941fb680e48 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_expand_and_top_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python customer_dimensions_list_expand_and_top_mca.py + python mca_customer_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_with_filter_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_with_filter_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py index a3904170e9fa..498fb66387df 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_dimensions_list_with_filter_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python customer_dimensions_list_with_filter_mca.py + python mca_customer_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py index d747fd1fd25b..4dcb6efde3d4 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python customer_query_mca.py + python mca_customer_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_grouping_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_grouping_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py index 370c57b3598f..c4c0ff727c0a 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/customer_query_grouping_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_customer_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python customer_query_grouping_mca.py + python mca_customer_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py index c4a07725f82c..11b68a17f4d4 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python invoice_section_dimensions_list_mca.py + python mca_invoice_section_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_expand_and_top_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_expand_and_top_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py index e05d46b14db1..e449f04d320c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_expand_and_top_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_expand_and_top.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python invoice_section_dimensions_list_expand_and_top_mca.py + python mca_invoice_section_dimensions_list_expand_and_top.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_with_filter_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_with_filter_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py index 4b31258e0748..14b352dfb098 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_dimensions_list_with_filter_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_dimensions_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python invoice_section_dimensions_list_with_filter_mca.py + python mca_invoice_section_dimensions_list_with_filter.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py index 2806276c3bc4..7a472df6af05 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python invoice_section_query_mca.py + python mca_invoice_section_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_grouping_mca.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_grouping_mca.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py index 3a2c41c46e53..2030ca2f13a1 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/invoice_section_query_grouping_mca.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/mca_invoice_section_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python invoice_section_query_grouping_mca.py + python mca_invoice_section_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_view.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py index e09871ae27bc..5b4bfb8a3143 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_view.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python create_or_update_private_view.py + python private_view_create_or_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/delete_private_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/delete_private_view.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py index e350deadd5e2..b8691b3f4fb1 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/delete_private_view.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_view_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python delete_private_view.py + python private_view_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py index 0751066e2ecd..d8c4c9543dc6 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_dimensions_list_legacy.py + python resource_group_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py index 720819019ae1..e4556d516b5f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_query_legacy.py + python resource_group_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py index dccb30a3b80b..1d63d0bafb57 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_query_grouping_legacy.py + python resource_group_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_account.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_account.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_account.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_account.py index 7c1b071290df..c09892637945 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_account.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_account.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python savings_plan_utilization_summaries_billing_account.py + python savings_plan_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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_profile.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_profile.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_profile.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_profile.py index ec5ccd3453db..83fd2506ae40 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_billing_profile.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_billing_profile.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python savings_plan_utilization_summaries_billing_profile.py + python savings_plan_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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_monthly_with_savings_plan_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_id_monthly.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_monthly_with_savings_plan_id.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_id_monthly.py index 6b75daf0eb01..a3451662d9a5 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_monthly_with_savings_plan_id.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_id_monthly.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python savings_plan_utilization_summaries_monthly_with_savings_plan_id.py + python savings_plan_savings_plan_id_monthly.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_daily.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_order_id_daily.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_daily.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_order_id_daily.py index d925c8e02a7a..6aa7f30f86ef 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_utilization_summaries_daily.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/savings_plan_savings_plan_order_id_daily.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python savings_plan_utilization_summaries_daily.py + python savings_plan_savings_plan_order_id_daily.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_scheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateprivate.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_scheduled_action.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateprivate.py index bcdc140924c3..eccd776b189f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_private_scheduled_action.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python create_or_update_private_scheduled_action.py + python scheduled_actioncreate_or_updateprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_scheduled_action_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_scheduled_action_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateshared.py index 695c27d7ee9e..957b8e9f1f5d 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_scheduled_action_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioncreate_or_updateshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python create_or_update_scheduled_action_by_scope.py + python scheduled_actioncreate_or_updateshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action_delete.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action_delete.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py index 430d92a77b88..b9968da9988f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action_delete.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python private_scheduled_action_delete.py + python scheduled_actiondeleteprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_delete_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_delete_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py index 16475554ac21..e15ae55c9e38 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_delete_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiondeleteshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_delete_by_scope.py + python scheduled_actiondeleteshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetprivate.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetprivate.py index b8a398bb6e47..baf04b00199f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_action.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python private_scheduled_action.py + python scheduled_actiongetprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetshared.py index 66e919a9c25c..b21a8394b3cf 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actiongetshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_by_scope.py + python scheduled_actiongetshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_insight_alert_scheduled_action_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioninsight_alertcreate_or_updateshared.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_insight_alert_scheduled_action_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioninsight_alertcreate_or_updateshared.py index b7ac0ac4ce37..fa047b3903d5 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/create_or_update_insight_alert_scheduled_action_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actioninsight_alertcreate_or_updateshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python create_or_update_insight_alert_scheduled_action_by_scope.py + python scheduled_actioninsight_alertcreate_or_updateshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_send_now.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_send_now.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py index 74503ffeab06..92eef175aadf 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_send_now.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_send_now.py + python scheduled_actionsend_nowprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_run_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_run_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py index d24de12f2a17..49447cdac074 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_action_run_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionsend_nowshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_action_run_by_scope.py + python scheduled_actionsend_nowshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list_filter_by_view_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filterprivate.py similarity index 95% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list_filter_by_view_id.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filterprivate.py index 6814e9ba13ae..229644b5997f 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list_filter_by_view_id.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filterprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python private_scheduled_actions_list_filter_by_view_id.py + python scheduled_actionslist_with_filterprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope_filter_by_view_id.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filtershared.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope_filter_by_view_id.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filtershared.py index 1707a00ae03d..9815805b19a2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope_filter_by_view_id.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslist_with_filtershared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_actions_list_by_scope_filter_by_view_id.py + python scheduled_actionslist_with_filtershared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistprivate.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistprivate.py index efd002ebf1b2..7e1bb07a89f8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/private_scheduled_actions_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistprivate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python private_scheduled_actions_list.py + python scheduled_actionslistprivate.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistshared.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistshared.py index 64d591648bd6..1ce7057cf63c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actions_list_by_scope.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/scheduled_actionslistshared.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python scheduled_actions_list_by_scope.py + python scheduled_actionslistshared.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alerts.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py index c5e02e62edcc..9d9f5742c791 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alerts.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_resource_group_alert.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python single_resource_group_alerts.py + python single_resource_group_alert.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alerts.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alerts.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py index f3d53894a833..3a504fe6fdb2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alerts.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/single_subscription_alert.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python single_subscription_alerts.py + python single_subscription_alert.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py similarity index 96% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py index 33c508bb1abc..7c82f57ea2ff 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_dimensions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python subscription_dimensions_list_legacy.py + python subscription_dimensions_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py index e3a8e45fdcb5..a80a9cb721c8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python subscription_query_legacy.py + python subscription_query.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping_legacy.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping_legacy.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py index eed3d3246164..90f56b4f701e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping_legacy.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/subscription_query_grouping.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python subscription_query_grouping_legacy.py + python subscription_query_grouping.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py index e9fcfb3a18e2..8ebf3ed7deec 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_view.py + python view_by_resource_group.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_create_or_update_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py similarity index 98% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_create_or_update_view.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py index ddb41feb5c8f..0c0f6a148b5b 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_create_or_update_view.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_create_or_update_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_create_or_update_view.py + python view_create_or_update_by_resource_group.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_delete_view.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_delete_view.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py index 3e11c6382498..f4c370b8b313 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_delete_view.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_delete_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_delete_view.py + python view_delete_by_resource_group.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, diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view_list.py b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py similarity index 97% rename from sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view_list.py rename to sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py index 369b82d349b3..13608bc5eb00 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/resource_group_view_list.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/generated_samples/view_list_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-costmanagement # USAGE - python resource_group_view_list.py + python view_list_by_resource_group.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,