diff --git a/sdk/billing/azure-mgmt-billing/MANIFEST.in b/sdk/billing/azure-mgmt-billing/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/billing/azure-mgmt-billing/MANIFEST.in +++ b/sdk/billing/azure-mgmt-billing/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/billing/azure-mgmt-billing/_meta.json b/sdk/billing/azure-mgmt-billing/_meta.json new file mode 100644 index 000000000000..111c7a0612e3 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.3.0", + "use": "@autorest/python@5.6.6", + "commit": "1e43e60cfb0bb2829ff8d57a9ba06a2410f0b3c0", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/billing/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", + "readme": "specification/billing/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py index a9fcde3b7cd4..a1e2d429dd3b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import BillingManagementClientConfiguration from .operations import BillingAccountsOperations @@ -36,6 +37,7 @@ from .operations import BillingRoleDefinitionsOperations from .operations import BillingRoleAssignmentsOperations from .operations import AgreementsOperations +from .operations import ReservationsOperations from .operations import EnrollmentAccountsOperations from .operations import BillingPeriodsOperations from . import models @@ -80,6 +82,8 @@ class BillingManagementClient(object): :vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations :ivar agreements: AgreementsOperations operations :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations + :ivar reservations: ReservationsOperations operations + :vartype reservations: azure.mgmt.billing.operations.ReservationsOperations :ivar enrollment_accounts: EnrollmentAccountsOperations operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations :ivar billing_periods: BillingPeriodsOperations operations @@ -146,11 +150,31 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.agreements = AgreementsOperations( self._client, self._config, self._serialize, self._deserialize) + self.reservations = ReservationsOperations( + self._client, self._config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self._config, self._serialize, self._deserialize) self.billing_periods = BillingPeriodsOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_metadata.json b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_metadata.json new file mode 100644 index 000000000000..7a518fc45a10 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_metadata.json @@ -0,0 +1,123 @@ +{ + "chosen_version": "", + "total_api_version_list": ["2018-03-01-preview", "2020-05-01"], + "client": { + "name": "BillingManagementClient", + "filename": "_billing_management_client", + "description": "Billing client provides access to billing resources for Azure subscriptions.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"BillingManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"BillingManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID that uniquely identifies an Azure subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID that uniquely identifies an Azure subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "billing_accounts": "BillingAccountsOperations", + "address": "AddressOperations", + "available_balances": "AvailableBalancesOperations", + "instructions": "InstructionsOperations", + "billing_profiles": "BillingProfilesOperations", + "customers": "CustomersOperations", + "invoice_sections": "InvoiceSectionsOperations", + "billing_permissions": "BillingPermissionsOperations", + "billing_subscriptions": "BillingSubscriptionsOperations", + "products": "ProductsOperations", + "invoices": "InvoicesOperations", + "transactions": "TransactionsOperations", + "policies": "PoliciesOperations", + "billing_property": "BillingPropertyOperations", + "operations": "Operations", + "billing_role_definitions": "BillingRoleDefinitionsOperations", + "billing_role_assignments": "BillingRoleAssignmentsOperations", + "agreements": "AgreementsOperations", + "reservations": "ReservationsOperations", + "enrollment_accounts": "EnrollmentAccountsOperations", + "billing_periods": "BillingPeriodsOperations" + } +} \ No newline at end of file diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_version.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_version.py index a17dc4d2fef4..92721eef7dd5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_version.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.0.0b1" +VERSION = "0.3.0" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/_billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/_billing_management_client.py index 84873e6cd155..dfa4bc08b5e9 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/_billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/_billing_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -34,6 +35,7 @@ from .operations import BillingRoleDefinitionsOperations from .operations import BillingRoleAssignmentsOperations from .operations import AgreementsOperations +from .operations import ReservationsOperations from .operations import EnrollmentAccountsOperations from .operations import BillingPeriodsOperations from .. import models @@ -78,6 +80,8 @@ class BillingManagementClient(object): :vartype billing_role_assignments: azure.mgmt.billing.aio.operations.BillingRoleAssignmentsOperations :ivar agreements: AgreementsOperations operations :vartype agreements: azure.mgmt.billing.aio.operations.AgreementsOperations + :ivar reservations: ReservationsOperations operations + :vartype reservations: azure.mgmt.billing.aio.operations.ReservationsOperations :ivar enrollment_accounts: EnrollmentAccountsOperations operations :vartype enrollment_accounts: azure.mgmt.billing.aio.operations.EnrollmentAccountsOperations :ivar billing_periods: BillingPeriodsOperations operations @@ -143,11 +147,30 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.agreements = AgreementsOperations( self._client, self._config, self._serialize, self._deserialize) + self.reservations = ReservationsOperations( + self._client, self._config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self._config, self._serialize, self._deserialize) self.billing_periods = BillingPeriodsOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/__init__.py index 34c9bbb22429..7f7bbc76fedb 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/__init__.py @@ -24,6 +24,7 @@ from ._billing_role_definitions_operations import BillingRoleDefinitionsOperations from ._billing_role_assignments_operations import BillingRoleAssignmentsOperations from ._agreements_operations import AgreementsOperations +from ._reservations_operations import ReservationsOperations from ._enrollment_accounts_operations import EnrollmentAccountsOperations from ._billing_periods_operations import BillingPeriodsOperations @@ -46,6 +47,7 @@ 'BillingRoleDefinitionsOperations', 'BillingRoleAssignmentsOperations', 'AgreementsOperations', + 'ReservationsOperations', 'EnrollmentAccountsOperations', 'BillingPeriodsOperations', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_address_operations.py index b858d166c2f7..37a5150ec00f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_address_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_address_operations.py @@ -85,7 +85,7 @@ async def validate( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateAddressResponse', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_agreements_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_agreements_operations.py index ceea58372d56..426c9a6eae96 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_agreements_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_agreements_operations.py @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -168,7 +168,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Agreement', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_available_balances_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_available_balances_operations.py index 7bd75e2c846f..5737f68c973c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_available_balances_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_available_balances_operations.py @@ -89,7 +89,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AvailableBalance', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_accounts_operations.py index 1a2222e5734e..2ec6f0568c16 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_accounts_operations.py @@ -100,7 +100,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -159,7 +159,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingAccount', pipeline_response) @@ -210,7 +210,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -240,8 +240,8 @@ async def begin_update( :type parameters: ~azure.mgmt.billing.models.BillingAccountUpdateRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BillingAccount or the result of cls(response) @@ -352,7 +352,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_periods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_periods_operations.py index 091d34996f9f..f3e701e6a6aa 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_periods_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_periods_operations.py @@ -118,7 +118,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -175,7 +175,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingPeriod', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_permissions_operations.py index 67da7af78225..613e0189287e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_permissions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_permissions_operations.py @@ -104,7 +104,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -174,7 +174,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -252,7 +252,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -326,7 +326,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_profiles_operations.py index 80cd617d4500..0c7eaffb8d05 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_profiles_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_profiles_operations.py @@ -108,7 +108,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -172,7 +172,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProfile', pipeline_response) @@ -225,7 +225,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -261,8 +261,8 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.billing.models.BillingProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BillingProfile or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_property_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_property_operations.py index 85964aaa0129..f54dfc955f5a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_property_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_property_operations.py @@ -81,7 +81,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProperty', pipeline_response) @@ -143,7 +143,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProperty', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_assignments_operations.py index d17f024a0066..342d85b97e5f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_assignments_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_assignments_operations.py @@ -90,7 +90,7 @@ async def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -150,7 +150,7 @@ async def delete_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -217,7 +217,7 @@ async def get_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -284,7 +284,7 @@ async def delete_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -348,7 +348,7 @@ async def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -412,7 +412,7 @@ async def delete_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -484,7 +484,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -563,7 +563,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -638,7 +638,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_definitions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_definitions_operations.py index c83120d450f8..1ed6da928727 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_definitions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_role_definitions_operations.py @@ -89,7 +89,7 @@ async def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -156,7 +156,7 @@ async def get_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -219,7 +219,7 @@ async def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -290,7 +290,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -369,7 +369,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -444,7 +444,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_subscriptions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_subscriptions_operations.py index 1ac5a035164c..a147b51fbca7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_subscriptions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_billing_subscriptions_operations.py @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -178,7 +178,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -254,7 +254,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -333,7 +333,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -389,7 +389,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingSubscription', pipeline_response) @@ -455,7 +455,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingSubscription', pipeline_response) @@ -507,7 +507,7 @@ async def _move_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -541,8 +541,8 @@ async def begin_move( :type parameters: ~azure.mgmt.billing.models.TransferBillingSubscriptionRequestProperties :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BillingSubscription or the result of cls(response) @@ -647,7 +647,7 @@ async def validate_move( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateSubscriptionTransferEligibilityResult', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_customers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_customers_operations.py index 6d941fbcf919..a8635fd4abb1 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_customers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_customers_operations.py @@ -116,7 +116,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -198,7 +198,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -262,7 +262,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Customer', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_enrollment_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_enrollment_accounts_operations.py index f9221e266f8e..6d32fb128cef 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_enrollment_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_enrollment_accounts_operations.py @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EnrollmentAccountSummary', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_instructions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_instructions_operations.py index ce1f01fbc288..f5b457ab7aba 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_instructions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_instructions_operations.py @@ -104,7 +104,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -167,7 +167,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Instruction', pipeline_response) @@ -238,7 +238,7 @@ async def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Instruction', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoice_sections_operations.py index a37b07168611..ffca6262fe47 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoice_sections_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoice_sections_operations.py @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -170,7 +170,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('InvoiceSection', pipeline_response) @@ -225,7 +225,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -264,8 +264,8 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.billing.models.InvoiceSection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either InvoiceSection or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoices_operations.py index 33f588d220a7..ac7fe13b4d95 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoices_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_invoices_operations.py @@ -59,8 +59,8 @@ def list_by_billing_account( :param period_start_date: The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. :type period_start_date: str - :param period_end_date: The end date to fetch the invoices. The date should be specified in MM- - DD-YYYY format. + :param period_end_date: The end date to fetch the invoices. The date should be specified in + MM-DD-YYYY format. :type period_end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either InvoiceListResult or the result of cls(response) @@ -114,7 +114,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -144,8 +144,8 @@ def list_by_billing_profile( :param period_start_date: The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. :type period_start_date: str - :param period_end_date: The end date to fetch the invoices. The date should be specified in MM- - DD-YYYY format. + :param period_end_date: The end date to fetch the invoices. The date should be specified in + MM-DD-YYYY format. :type period_end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either InvoiceListResult or the result of cls(response) @@ -200,7 +200,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -259,7 +259,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -314,7 +314,7 @@ async def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -363,7 +363,7 @@ async def _download_invoice_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -399,8 +399,8 @@ async def begin_download_invoice( :type download_token: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DownloadUrl or the result of cls(response) @@ -492,7 +492,7 @@ async def _download_multiple_billing_profile_invoices_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -526,8 +526,8 @@ async def begin_download_multiple_billing_profile_invoices( :type download_urls: list[str] :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DownloadUrl or the result of cls(response) @@ -641,7 +641,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -696,7 +696,7 @@ async def get_by_subscription_and_invoice_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -744,7 +744,7 @@ async def _download_billing_subscription_invoice_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -776,8 +776,8 @@ async def begin_download_billing_subscription_invoice( :type download_token: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DownloadUrl or the result of cls(response) @@ -867,7 +867,7 @@ async def _download_multiple_billing_subscription_invoices_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -897,8 +897,8 @@ async def begin_download_multiple_billing_subscription_invoices( :type download_urls: list[str] :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DownloadUrl or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_operations.py index 9198f93fdff5..4ed3179d761e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_operations.py @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_policies_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_policies_operations.py index 85a1415d0d2f..4a328375a609 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_policies_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_policies_operations.py @@ -88,7 +88,7 @@ async def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Policy', pipeline_response) @@ -155,7 +155,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Policy', pipeline_response) @@ -214,7 +214,7 @@ async def get_by_customer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomerPolicy', pipeline_response) @@ -281,7 +281,7 @@ async def update_customer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomerPolicy', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_products_operations.py index 33c4665df036..1d172ed50a34 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_products_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_products_operations.py @@ -106,7 +106,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -185,7 +185,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -268,7 +268,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -355,7 +355,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -414,7 +414,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Product', pipeline_response) @@ -481,7 +481,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Product', pipeline_response) @@ -550,7 +550,7 @@ async def move( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -626,7 +626,7 @@ async def validate_move( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateProductTransferEligibilityResult', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_reservations_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_reservations_operations.py new file mode 100644 index 000000000000..f18d918e8450 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_reservations_operations.py @@ -0,0 +1,232 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsOperations: + """ReservationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.billing.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_billing_account( + self, + billing_account_name: str, + filter: Optional[str] = None, + orderby: Optional[str] = None, + refresh_summary: Optional[str] = None, + selected_state: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ReservationsListResult"]: + """Lists the reservations for a billing account and the roll up counts of reservations group by + provisioning states. + + :param billing_account_name: The ID that uniquely identifies a billing account. + :type billing_account_name: str + :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', + and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up counts of the reservations + group by provisioning states. + :type refresh_summary: str + :param selected_state: The selected provisioning state. + :type selected_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.billing.models.ReservationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ReservationsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations'} # type: ignore + + def list_by_billing_profile( + self, + billing_account_name: str, + billing_profile_name: str, + filter: Optional[str] = None, + orderby: Optional[str] = None, + refresh_summary: Optional[str] = None, + selected_state: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ReservationsListResult"]: + """Lists the reservations for a billing profile and the roll up counts of reservations group by + provisioning state. + + :param billing_account_name: The ID that uniquely identifies a billing account. + :type billing_account_name: str + :param billing_profile_name: The ID that uniquely identifies a billing profile. + :type billing_profile_name: str + :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', + and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up counts of the reservations + group by provisioning state. + :type refresh_summary: str + :param selected_state: The selected provisioning state. + :type selected_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.billing.models.ReservationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ReservationsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations'} # type: ignore diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_transactions_operations.py index 02bd273de55a..0d7a9a582c6d 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_transactions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/aio/operations/_transactions_operations.py @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 33834337f274..6f8996b88ee9 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -67,6 +67,12 @@ from ._models_py3 import ProductsListResult from ._models_py3 import RebillDetails from ._models_py3 import Reseller + from ._models_py3 import Reservation + from ._models_py3 import ReservationPropertyUtilization + from ._models_py3 import ReservationSkuProperty + from ._models_py3 import ReservationSummary + from ._models_py3 import ReservationUtilizationAggregates + from ._models_py3 import ReservationsListResult from ._models_py3 import Resource from ._models_py3 import Transaction from ._models_py3 import TransactionListResult @@ -138,6 +144,12 @@ from ._models import ProductsListResult # type: ignore from ._models import RebillDetails # type: ignore from ._models import Reseller # type: ignore + from ._models import Reservation # type: ignore + from ._models import ReservationPropertyUtilization # type: ignore + from ._models import ReservationSkuProperty # type: ignore + from ._models import ReservationSummary # type: ignore + from ._models import ReservationUtilizationAggregates # type: ignore + from ._models import ReservationsListResult # type: ignore from ._models import Resource # type: ignore from ._models import Transaction # type: ignore from ._models import TransactionListResult # type: ignore @@ -247,6 +259,12 @@ 'ProductsListResult', 'RebillDetails', 'Reseller', + 'Reservation', + 'ReservationPropertyUtilization', + 'ReservationSkuProperty', + 'ReservationSummary', + 'ReservationUtilizationAggregates', + 'ReservationsListResult', 'Resource', 'Transaction', 'TransactionListResult', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py index 01bcf556776d..336add87266a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py @@ -274,14 +274,26 @@ class SubscriptionTransferValidationErrorCode(with_metaclass(_CaseInsensitiveEnu """Error code of the transfer validation response. """ + BILLING_ACCOUNT_INACTIVE = "BillingAccountInactive" + CROSS_BILLING_ACCOUNT_NOT_ALLOWED = "CrossBillingAccountNotAllowed" + DESTINATION_BILLING_PROFILE_INACTIVE = "DestinationBillingProfileInactive" + DESTINATION_BILLING_PROFILE_NOT_FOUND = "DestinationBillingProfileNotFound" + DESTINATION_BILLING_PROFILE_PAST_DUE = "DestinationBillingProfilePastDue" + DESTINATION_INVOICE_SECTION_INACTIVE = "DestinationInvoiceSectionInactive" + DESTINATION_INVOICE_SECTION_NOT_FOUND = "DestinationInvoiceSectionNotFound" + INSUFFICIENT_PERMISSION_ON_DESTINATION = "InsufficientPermissionOnDestination" + INSUFFICIENT_PERMISSION_ON_SOURCE = "InsufficientPermissionOnSource" + INVALID_DESTINATION = "InvalidDestination" INVALID_SOURCE = "InvalidSource" + MARKETPLACE_NOT_ENABLED_ON_DESTINATION = "MarketplaceNotEnabledOnDestination" + NOT_AVAILABLE_FOR_DESTINATION_MARKET = "NotAvailableForDestinationMarket" + PRODUCT_INACTIVE = "ProductInactive" + PRODUCT_NOT_FOUND = "ProductNotFound" + PRODUCT_TYPE_NOT_SUPPORTED = "ProductTypeNotSupported" + SOURCE_BILLING_PROFILE_PAST_DUE = "SourceBillingProfilePastDue" + SOURCE_INVOICE_SECTION_INACTIVE = "SourceInvoiceSectionInactive" SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" - INSUFFICIENT_PERMISSION_ON_SOURCE = "InsufficientPermissionOnSource" - INSUFFICIENT_PERMISSION_ON_DESTINATION = "InsufficientPermissionOnDestination" - DESTINATION_BILLING_PROFILE_PAST_DUE = "DestinationBillingProfilePastDue" SUBSCRIPTION_TYPE_NOT_SUPPORTED = "SubscriptionTypeNotSupported" - CROSS_BILLING_ACCOUNT_NOT_ALLOWED = "CrossBillingAccountNotAllowed" - NOT_AVAILABLE_FOR_DESTINATION_MARKET = "NotAvailableForDestinationMarket" class TargetCloud(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Possible cloud environments. @@ -299,8 +311,8 @@ class TransactionTypeKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESERVATION = "reservation" class ViewCharges(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The policy that controls whether the users in customer's organization can view charges at pay- - as-you-go prices. + """The policy that controls whether the users in customer's organization can view charges at + pay-as-you-go prices. """ ALLOWED = "Allowed" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py index b9f8706551d8..993bca9cbfaa 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py @@ -17,6 +17,8 @@ class AddressDetails(msrest.serialization.Model): :param first_name: First name. :type first_name: str + :param middle_name: Middle name. + :type middle_name: str :param last_name: Last name. :type last_name: str :param company_name: Company name. @@ -50,6 +52,7 @@ class AddressDetails(msrest.serialization.Model): _attribute_map = { 'first_name': {'key': 'firstName', 'type': 'str'}, + 'middle_name': {'key': 'middleName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, 'address_line1': {'key': 'addressLine1', 'type': 'str'}, @@ -70,6 +73,7 @@ def __init__( ): super(AddressDetails, self).__init__(**kwargs) self.first_name = kwargs.get('first_name', None) + self.middle_name = kwargs.get('middle_name', None) self.last_name = kwargs.get('last_name', None) self.company_name = kwargs.get('company_name', None) self.address_line1 = kwargs['address_line1'] @@ -350,6 +354,8 @@ class BillingAccount(Resource): :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for legacy accounts. + :type notification_email_address: str """ _validation = { @@ -377,6 +383,7 @@ class BillingAccount(Resource): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__( @@ -394,6 +401,7 @@ def __init__( self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) self.has_read_access = None + self.notification_email_address = kwargs.get('notification_email_address', None) class BillingAccountListResult(msrest.serialization.Model): @@ -458,6 +466,8 @@ class BillingAccountUpdateRequest(msrest.serialization.Model): :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for legacy accounts. + :type notification_email_address: str """ _validation = { @@ -479,6 +489,7 @@ class BillingAccountUpdateRequest(msrest.serialization.Model): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__( @@ -496,6 +507,7 @@ def __init__( self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) self.has_read_access = None + self.notification_email_address = kwargs.get('notification_email_address', None) class BillingPeriod(Resource): @@ -688,6 +700,8 @@ class BillingProfile(Resource): profile. This is a system managed optional field and gets updated as the billing profile gets associated with accounts in various clouds. :vartype target_clouds: list[str or ~azure.mgmt.billing.models.TargetCloud] + :param tags: A set of tags. Tags of billing profiles. + :type tags: dict[str, str] """ _validation = { @@ -726,6 +740,7 @@ class BillingProfile(Resource): 'status_reason_code': {'key': 'properties.statusReasonCode', 'type': 'str'}, 'spending_limit': {'key': 'properties.spendingLimit', 'type': 'str'}, 'target_clouds': {'key': 'properties.targetClouds', 'type': '[str]'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__( @@ -749,6 +764,7 @@ def __init__( self.status_reason_code = None self.spending_limit = None self.target_clouds = None + self.tags = kwargs.get('tags', None) class BillingProfileCreationRequest(msrest.serialization.Model): @@ -1277,17 +1293,21 @@ class BillingSubscriptionsListResult(msrest.serialization.Model): :ivar value: The list of billing subscriptions. :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[BillingSubscription]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1297,6 +1317,7 @@ def __init__( ): super(BillingSubscriptionsListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -1361,17 +1382,21 @@ class CustomerListResult(msrest.serialization.Model): :ivar value: The list of customers. :vartype value: list[~azure.mgmt.billing.models.Customer] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[Customer]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1381,6 +1406,7 @@ def __init__( ): super(CustomerListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -1617,6 +1643,8 @@ class EnrollmentAccount(Resource): :type cost_center: str :param account_owner: The owner of the enrollment account. :type account_owner: str + :param account_owner_email: The enrollment account owner email address. + :type account_owner_email: str :param status: The status of the enrollment account. :type status: str :param start_date: The start date of the enrollment account. @@ -1641,6 +1669,7 @@ class EnrollmentAccount(Resource): 'account_name': {'key': 'properties.accountName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, @@ -1655,6 +1684,7 @@ def __init__( self.account_name = kwargs.get('account_name', None) self.cost_center = kwargs.get('cost_center', None) self.account_owner = kwargs.get('account_owner', None) + self.account_owner_email = kwargs.get('account_owner_email', None) self.status = kwargs.get('status', None) self.start_date = kwargs.get('start_date', None) self.end_date = kwargs.get('end_date', None) @@ -1770,9 +1800,9 @@ class EnrollmentPolicies(msrest.serialization.Model): :ivar department_admin_view_charges: The policy that controls whether Department Administrators can view charges. :vartype department_admin_view_charges: bool - :ivar marketplaces_enabled: The policy that controls whether Azure marketplace purchases are + :ivar marketplace_enabled: The policy that controls whether Azure marketplace purchases are allowed in the enrollment. - :vartype marketplaces_enabled: bool + :vartype marketplace_enabled: bool :ivar reserved_instances_enabled: The policy that controls whether Azure reservation purchases are allowed in the enrollment. :vartype reserved_instances_enabled: bool @@ -1781,14 +1811,14 @@ class EnrollmentPolicies(msrest.serialization.Model): _validation = { 'account_owner_view_charges': {'readonly': True}, 'department_admin_view_charges': {'readonly': True}, - 'marketplaces_enabled': {'readonly': True}, + 'marketplace_enabled': {'readonly': True}, 'reserved_instances_enabled': {'readonly': True}, } _attribute_map = { 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, - 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'marketplace_enabled': {'key': 'marketplaceEnabled', 'type': 'bool'}, 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, } @@ -1799,7 +1829,7 @@ def __init__( super(EnrollmentPolicies, self).__init__(**kwargs) self.account_owner_view_charges = None self.department_admin_view_charges = None - self.marketplaces_enabled = None + self.marketplace_enabled = None self.reserved_instances_enabled = None @@ -2292,17 +2322,21 @@ class InvoiceSectionListResult(msrest.serialization.Model): :ivar value: The list of invoice sections. :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2312,6 +2346,7 @@ def __init__( ): super(InvoiceSectionListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -2456,16 +2491,20 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str + :ivar is_data_action: Identifies if the operation is a data operation. + :vartype is_data_action: bool :param display: The object that represents the operation. :type display: ~azure.mgmt.billing.models.OperationDisplay """ _validation = { 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } @@ -2475,6 +2514,7 @@ def __init__( ): super(Operation, self).__init__(**kwargs) self.name = None + self.is_data_action = None self.display = kwargs.get('display', None) @@ -2490,18 +2530,22 @@ class OperationDisplay(msrest.serialization.Model): :vartype resource: str :ivar operation: Operation type such as read, write and delete. :vartype operation: str + :ivar description: Description of operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -2512,6 +2556,7 @@ def __init__( self.provider = None self.resource = None self.operation = None + self.description = None class OperationListResult(msrest.serialization.Model): @@ -2914,6 +2959,316 @@ def __init__( self.description = None +class Reservation(msrest.serialization.Model): + """The definition of the reservation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The id of the reservation. + :vartype id: str + :ivar name: The name of the reservation. + :vartype name: str + :ivar type: The type of the reservation. + :vartype type: str + :ivar location: The location of the reservation. + :vartype location: str + :param sku: The sku information associated to this reservation. + :type sku: ~azure.mgmt.billing.models.ReservationSkuProperty + :param applied_scopes: The array of applied scopes of a reservation. Will be null if the + reservation is in Shared scope. + :type applied_scopes: list[str] + :ivar applied_scope_type: The applied scope type of the reservation. + :vartype applied_scope_type: str + :ivar reserved_resource_type: The reserved source type of the reservation, e.g. virtual + machine. + :vartype reserved_resource_type: str + :ivar quantity: The number of the reservation. + :vartype quantity: float + :ivar provisioning_state: The provisioning state of the reservation, e.g. Succeeded. + :vartype provisioning_state: str + :ivar expiry_date: The expiry date of the reservation. + :vartype expiry_date: str + :ivar provisioning_sub_state: The provisioning state of the reservation, e.g. Succeeded. + :vartype provisioning_sub_state: str + :ivar display_name: The display name of the reservation. + :vartype display_name: str + :ivar display_provisioning_state: The provisioning state of the reservation for display, e.g. + Succeeded. + :vartype display_provisioning_state: str + :ivar user_friendly_renew_state: The renew state of the reservation for display, e.g. On. + :vartype user_friendly_renew_state: str + :ivar user_friendly_applied_scope_type: The applied scope type of the reservation for display, + e.g. Shared. + :vartype user_friendly_applied_scope_type: str + :ivar effective_date_time: The effective date time of the reservation. + :vartype effective_date_time: str + :ivar sku_description: The sku description of the reservation. + :vartype sku_description: str + :ivar term: The term of the reservation, e.g. P1Y. + :vartype term: str + :ivar renew: The renew state of the reservation. + :vartype renew: bool + :ivar renew_source: The renew source of the reservation. + :vartype renew_source: str + :ivar utilization: Reservation utilization. + :vartype utilization: ~azure.mgmt.billing.models.ReservationPropertyUtilization + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'applied_scope_type': {'readonly': True}, + 'reserved_resource_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'provisioning_sub_state': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_provisioning_state': {'readonly': True}, + 'user_friendly_renew_state': {'readonly': True}, + 'user_friendly_applied_scope_type': {'readonly': True}, + 'effective_date_time': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'term': {'readonly': True}, + 'renew': {'readonly': True}, + 'renew_source': {'readonly': True}, + 'utilization': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ReservationSkuProperty'}, + 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, + 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + 'provisioning_sub_state': {'key': 'properties.provisioningSubState', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'display_provisioning_state': {'key': 'properties.displayProvisioningState', 'type': 'str'}, + 'user_friendly_renew_state': {'key': 'properties.userFriendlyRenewState', 'type': 'str'}, + 'user_friendly_applied_scope_type': {'key': 'properties.userFriendlyAppliedScopeType', 'type': 'str'}, + 'effective_date_time': {'key': 'properties.effectiveDateTime', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'renew': {'key': 'properties.renew', 'type': 'bool'}, + 'renew_source': {'key': 'properties.renewSource', 'type': 'str'}, + 'utilization': {'key': 'properties.utilization', 'type': 'ReservationPropertyUtilization'}, + } + + def __init__( + self, + **kwargs + ): + super(Reservation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.sku = kwargs.get('sku', None) + self.applied_scopes = kwargs.get('applied_scopes', None) + self.applied_scope_type = None + self.reserved_resource_type = None + self.quantity = None + self.provisioning_state = None + self.expiry_date = None + self.provisioning_sub_state = None + self.display_name = None + self.display_provisioning_state = None + self.user_friendly_renew_state = None + self.user_friendly_applied_scope_type = None + self.effective_date_time = None + self.sku_description = None + self.term = None + self.renew = None + self.renew_source = None + self.utilization = None + + +class ReservationPropertyUtilization(msrest.serialization.Model): + """Reservation utilization. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trend: The number of days trend for a reservation. + :vartype trend: str + :param aggregates: The array of aggregates of a reservation's utilization. + :type aggregates: list[~azure.mgmt.billing.models.ReservationUtilizationAggregates] + """ + + _validation = { + 'trend': {'readonly': True}, + } + + _attribute_map = { + 'trend': {'key': 'trend', 'type': 'str'}, + 'aggregates': {'key': 'aggregates', 'type': '[ReservationUtilizationAggregates]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationPropertyUtilization, self).__init__(**kwargs) + self.trend = None + self.aggregates = kwargs.get('aggregates', None) + + +class ReservationSkuProperty(msrest.serialization.Model): + """The property of reservation sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the reservation sku. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSkuProperty, self).__init__(**kwargs) + self.name = None + + +class ReservationsListResult(msrest.serialization.Model): + """The list of reservations and summary of roll out count of reservations in each state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservations. + :vartype value: list[~azure.mgmt.billing.models.Reservation] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :param summary: The roll out count summary of the reservations. + :type summary: ~azure.mgmt.billing.models.ReservationSummary + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Reservation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'ReservationSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + self.summary = kwargs.get('summary', None) + + +class ReservationSummary(msrest.serialization.Model): + """The roll up count summary of reservations in each state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar succeeded_count: The number of reservation in Succeeded state. + :vartype succeeded_count: float + :ivar failed_count: The number of reservation in Failed state. + :vartype failed_count: float + :ivar expiring_count: The number of reservation in Expiring state. + :vartype expiring_count: float + :ivar expired_count: The number of reservation in Expired state. + :vartype expired_count: float + :ivar pending_count: The number of reservation in Pending state. + :vartype pending_count: float + :ivar cancelled_count: The number of reservation in Cancelled state. + :vartype cancelled_count: float + """ + + _validation = { + 'succeeded_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'expiring_count': {'readonly': True}, + 'expired_count': {'readonly': True}, + 'pending_count': {'readonly': True}, + 'cancelled_count': {'readonly': True}, + } + + _attribute_map = { + 'succeeded_count': {'key': 'succeededCount', 'type': 'float'}, + 'failed_count': {'key': 'failedCount', 'type': 'float'}, + 'expiring_count': {'key': 'expiringCount', 'type': 'float'}, + 'expired_count': {'key': 'expiredCount', 'type': 'float'}, + 'pending_count': {'key': 'pendingCount', 'type': 'float'}, + 'cancelled_count': {'key': 'cancelledCount', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummary, self).__init__(**kwargs) + self.succeeded_count = None + self.failed_count = None + self.expiring_count = None + self.expired_count = None + self.pending_count = None + self.cancelled_count = None + + +class ReservationUtilizationAggregates(msrest.serialization.Model): + """The aggregate values of reservation utilization. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar grain: The grain of the aggregate. + :vartype grain: float + :ivar grain_unit: The grain unit of the aggregate. + :vartype grain_unit: str + :ivar value: The aggregate value. + :vartype value: float + :ivar value_unit: The aggregate value unit. + :vartype value_unit: str + """ + + _validation = { + 'grain': {'readonly': True}, + 'grain_unit': {'readonly': True}, + 'value': {'readonly': True}, + 'value_unit': {'readonly': True}, + } + + _attribute_map = { + 'grain': {'key': 'grain', 'type': 'float'}, + 'grain_unit': {'key': 'grainUnit', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + 'value_unit': {'key': 'valueUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationUtilizationAggregates, self).__init__(**kwargs) + self.grain = None + self.grain_unit = None + self.value = None + self.value_unit = None + + class Transaction(Resource): """A transaction. @@ -3308,10 +3663,13 @@ class ValidateSubscriptionTransferEligibilityError(msrest.serialization.Model): """Error details of the transfer eligibility validation. :param code: Error code for the product transfer validation. Possible values include: - "InvalidSource", "SubscriptionNotActive", "InsufficientPermissionOnSource", - "InsufficientPermissionOnDestination", "DestinationBillingProfilePastDue", - "SubscriptionTypeNotSupported", "CrossBillingAccountNotAllowed", - "NotAvailableForDestinationMarket". + "BillingAccountInactive", "CrossBillingAccountNotAllowed", "DestinationBillingProfileInactive", + "DestinationBillingProfileNotFound", "DestinationBillingProfilePastDue", + "DestinationInvoiceSectionInactive", "DestinationInvoiceSectionNotFound", + "InsufficientPermissionOnDestination", "InsufficientPermissionOnSource", "InvalidDestination", + "InvalidSource", "MarketplaceNotEnabledOnDestination", "NotAvailableForDestinationMarket", + "ProductInactive", "ProductNotFound", "ProductTypeNotSupported", "SourceBillingProfilePastDue", + "SourceInvoiceSectionInactive", "SubscriptionNotActive", "SubscriptionTypeNotSupported". :type code: str or ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode :param message: The error message. :type message: str diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py index 0e08138f8349..945556626fdb 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py @@ -22,6 +22,8 @@ class AddressDetails(msrest.serialization.Model): :param first_name: First name. :type first_name: str + :param middle_name: Middle name. + :type middle_name: str :param last_name: Last name. :type last_name: str :param company_name: Company name. @@ -55,6 +57,7 @@ class AddressDetails(msrest.serialization.Model): _attribute_map = { 'first_name': {'key': 'firstName', 'type': 'str'}, + 'middle_name': {'key': 'middleName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, 'address_line1': {'key': 'addressLine1', 'type': 'str'}, @@ -75,6 +78,7 @@ def __init__( address_line1: str, country: str, first_name: Optional[str] = None, + middle_name: Optional[str] = None, last_name: Optional[str] = None, company_name: Optional[str] = None, address_line2: Optional[str] = None, @@ -89,6 +93,7 @@ def __init__( ): super(AddressDetails, self).__init__(**kwargs) self.first_name = first_name + self.middle_name = middle_name self.last_name = last_name self.company_name = company_name self.address_line1 = address_line1 @@ -375,6 +380,8 @@ class BillingAccount(Resource): :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for legacy accounts. + :type notification_email_address: str """ _validation = { @@ -402,6 +409,7 @@ class BillingAccount(Resource): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__( @@ -412,6 +420,7 @@ def __init__( billing_profiles: Optional["BillingProfilesOnExpand"] = None, departments: Optional[List["Department"]] = None, enrollment_accounts: Optional[List["EnrollmentAccount"]] = None, + notification_email_address: Optional[str] = None, **kwargs ): super(BillingAccount, self).__init__(**kwargs) @@ -425,6 +434,7 @@ def __init__( self.departments = departments self.enrollment_accounts = enrollment_accounts self.has_read_access = None + self.notification_email_address = notification_email_address class BillingAccountListResult(msrest.serialization.Model): @@ -489,6 +499,8 @@ class BillingAccountUpdateRequest(msrest.serialization.Model): :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for legacy accounts. + :type notification_email_address: str """ _validation = { @@ -510,6 +522,7 @@ class BillingAccountUpdateRequest(msrest.serialization.Model): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__( @@ -520,6 +533,7 @@ def __init__( billing_profiles: Optional["BillingProfilesOnExpand"] = None, departments: Optional[List["Department"]] = None, enrollment_accounts: Optional[List["EnrollmentAccount"]] = None, + notification_email_address: Optional[str] = None, **kwargs ): super(BillingAccountUpdateRequest, self).__init__(**kwargs) @@ -533,6 +547,7 @@ def __init__( self.departments = departments self.enrollment_accounts = enrollment_accounts self.has_read_access = None + self.notification_email_address = notification_email_address class BillingPeriod(Resource): @@ -725,6 +740,8 @@ class BillingProfile(Resource): profile. This is a system managed optional field and gets updated as the billing profile gets associated with accounts in various clouds. :vartype target_clouds: list[str or ~azure.mgmt.billing.models.TargetCloud] + :param tags: A set of tags. Tags of billing profiles. + :type tags: dict[str, str] """ _validation = { @@ -763,6 +780,7 @@ class BillingProfile(Resource): 'status_reason_code': {'key': 'properties.statusReasonCode', 'type': 'str'}, 'spending_limit': {'key': 'properties.spendingLimit', 'type': 'str'}, 'target_clouds': {'key': 'properties.targetClouds', 'type': '[str]'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__( @@ -774,6 +792,7 @@ def __init__( invoice_email_opt_in: Optional[bool] = None, enabled_azure_plans: Optional[List["AzurePlan"]] = None, invoice_sections: Optional["InvoiceSectionsOnExpand"] = None, + tags: Optional[Dict[str, str]] = None, **kwargs ): super(BillingProfile, self).__init__(**kwargs) @@ -793,6 +812,7 @@ def __init__( self.status_reason_code = None self.spending_limit = None self.target_clouds = None + self.tags = tags class BillingProfileCreationRequest(msrest.serialization.Model): @@ -1343,17 +1363,21 @@ class BillingSubscriptionsListResult(msrest.serialization.Model): :ivar value: The list of billing subscriptions. :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[BillingSubscription]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1363,6 +1387,7 @@ def __init__( ): super(BillingSubscriptionsListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -1431,17 +1456,21 @@ class CustomerListResult(msrest.serialization.Model): :ivar value: The list of customers. :vartype value: list[~azure.mgmt.billing.models.Customer] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[Customer]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1451,6 +1480,7 @@ def __init__( ): super(CustomerListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -1697,6 +1727,8 @@ class EnrollmentAccount(Resource): :type cost_center: str :param account_owner: The owner of the enrollment account. :type account_owner: str + :param account_owner_email: The enrollment account owner email address. + :type account_owner_email: str :param status: The status of the enrollment account. :type status: str :param start_date: The start date of the enrollment account. @@ -1721,6 +1753,7 @@ class EnrollmentAccount(Resource): 'account_name': {'key': 'properties.accountName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, @@ -1733,6 +1766,7 @@ def __init__( account_name: Optional[str] = None, cost_center: Optional[str] = None, account_owner: Optional[str] = None, + account_owner_email: Optional[str] = None, status: Optional[str] = None, start_date: Optional[datetime.datetime] = None, end_date: Optional[datetime.datetime] = None, @@ -1743,6 +1777,7 @@ def __init__( self.account_name = account_name self.cost_center = cost_center self.account_owner = account_owner + self.account_owner_email = account_owner_email self.status = status self.start_date = start_date self.end_date = end_date @@ -1863,9 +1898,9 @@ class EnrollmentPolicies(msrest.serialization.Model): :ivar department_admin_view_charges: The policy that controls whether Department Administrators can view charges. :vartype department_admin_view_charges: bool - :ivar marketplaces_enabled: The policy that controls whether Azure marketplace purchases are + :ivar marketplace_enabled: The policy that controls whether Azure marketplace purchases are allowed in the enrollment. - :vartype marketplaces_enabled: bool + :vartype marketplace_enabled: bool :ivar reserved_instances_enabled: The policy that controls whether Azure reservation purchases are allowed in the enrollment. :vartype reserved_instances_enabled: bool @@ -1874,14 +1909,14 @@ class EnrollmentPolicies(msrest.serialization.Model): _validation = { 'account_owner_view_charges': {'readonly': True}, 'department_admin_view_charges': {'readonly': True}, - 'marketplaces_enabled': {'readonly': True}, + 'marketplace_enabled': {'readonly': True}, 'reserved_instances_enabled': {'readonly': True}, } _attribute_map = { 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, - 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'marketplace_enabled': {'key': 'marketplaceEnabled', 'type': 'bool'}, 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, } @@ -1892,7 +1927,7 @@ def __init__( super(EnrollmentPolicies, self).__init__(**kwargs) self.account_owner_view_charges = None self.department_admin_view_charges = None - self.marketplaces_enabled = None + self.marketplace_enabled = None self.reserved_instances_enabled = None @@ -2401,17 +2436,21 @@ class InvoiceSectionListResult(msrest.serialization.Model): :ivar value: The list of invoice sections. :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar total_count: Total number of records. + :vartype total_count: int :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'total_count': {'readonly': True}, 'next_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2421,6 +2460,7 @@ def __init__( ): super(InvoiceSectionListResult, self).__init__(**kwargs) self.value = None + self.total_count = None self.next_link = None @@ -2571,16 +2611,20 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str + :ivar is_data_action: Identifies if the operation is a data operation. + :vartype is_data_action: bool :param display: The object that represents the operation. :type display: ~azure.mgmt.billing.models.OperationDisplay """ _validation = { 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } @@ -2592,6 +2636,7 @@ def __init__( ): super(Operation, self).__init__(**kwargs) self.name = None + self.is_data_action = None self.display = display @@ -2607,18 +2652,22 @@ class OperationDisplay(msrest.serialization.Model): :vartype resource: str :ivar operation: Operation type such as read, write and delete. :vartype operation: str + :ivar description: Description of operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -2629,6 +2678,7 @@ def __init__( self.provider = None self.resource = None self.operation = None + self.description = None class OperationListResult(msrest.serialization.Model): @@ -3041,6 +3091,323 @@ def __init__( self.description = None +class Reservation(msrest.serialization.Model): + """The definition of the reservation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The id of the reservation. + :vartype id: str + :ivar name: The name of the reservation. + :vartype name: str + :ivar type: The type of the reservation. + :vartype type: str + :ivar location: The location of the reservation. + :vartype location: str + :param sku: The sku information associated to this reservation. + :type sku: ~azure.mgmt.billing.models.ReservationSkuProperty + :param applied_scopes: The array of applied scopes of a reservation. Will be null if the + reservation is in Shared scope. + :type applied_scopes: list[str] + :ivar applied_scope_type: The applied scope type of the reservation. + :vartype applied_scope_type: str + :ivar reserved_resource_type: The reserved source type of the reservation, e.g. virtual + machine. + :vartype reserved_resource_type: str + :ivar quantity: The number of the reservation. + :vartype quantity: float + :ivar provisioning_state: The provisioning state of the reservation, e.g. Succeeded. + :vartype provisioning_state: str + :ivar expiry_date: The expiry date of the reservation. + :vartype expiry_date: str + :ivar provisioning_sub_state: The provisioning state of the reservation, e.g. Succeeded. + :vartype provisioning_sub_state: str + :ivar display_name: The display name of the reservation. + :vartype display_name: str + :ivar display_provisioning_state: The provisioning state of the reservation for display, e.g. + Succeeded. + :vartype display_provisioning_state: str + :ivar user_friendly_renew_state: The renew state of the reservation for display, e.g. On. + :vartype user_friendly_renew_state: str + :ivar user_friendly_applied_scope_type: The applied scope type of the reservation for display, + e.g. Shared. + :vartype user_friendly_applied_scope_type: str + :ivar effective_date_time: The effective date time of the reservation. + :vartype effective_date_time: str + :ivar sku_description: The sku description of the reservation. + :vartype sku_description: str + :ivar term: The term of the reservation, e.g. P1Y. + :vartype term: str + :ivar renew: The renew state of the reservation. + :vartype renew: bool + :ivar renew_source: The renew source of the reservation. + :vartype renew_source: str + :ivar utilization: Reservation utilization. + :vartype utilization: ~azure.mgmt.billing.models.ReservationPropertyUtilization + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'applied_scope_type': {'readonly': True}, + 'reserved_resource_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'provisioning_sub_state': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_provisioning_state': {'readonly': True}, + 'user_friendly_renew_state': {'readonly': True}, + 'user_friendly_applied_scope_type': {'readonly': True}, + 'effective_date_time': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'term': {'readonly': True}, + 'renew': {'readonly': True}, + 'renew_source': {'readonly': True}, + 'utilization': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ReservationSkuProperty'}, + 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, + 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + 'provisioning_sub_state': {'key': 'properties.provisioningSubState', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'display_provisioning_state': {'key': 'properties.displayProvisioningState', 'type': 'str'}, + 'user_friendly_renew_state': {'key': 'properties.userFriendlyRenewState', 'type': 'str'}, + 'user_friendly_applied_scope_type': {'key': 'properties.userFriendlyAppliedScopeType', 'type': 'str'}, + 'effective_date_time': {'key': 'properties.effectiveDateTime', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'renew': {'key': 'properties.renew', 'type': 'bool'}, + 'renew_source': {'key': 'properties.renewSource', 'type': 'str'}, + 'utilization': {'key': 'properties.utilization', 'type': 'ReservationPropertyUtilization'}, + } + + def __init__( + self, + *, + sku: Optional["ReservationSkuProperty"] = None, + applied_scopes: Optional[List[str]] = None, + **kwargs + ): + super(Reservation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.sku = sku + self.applied_scopes = applied_scopes + self.applied_scope_type = None + self.reserved_resource_type = None + self.quantity = None + self.provisioning_state = None + self.expiry_date = None + self.provisioning_sub_state = None + self.display_name = None + self.display_provisioning_state = None + self.user_friendly_renew_state = None + self.user_friendly_applied_scope_type = None + self.effective_date_time = None + self.sku_description = None + self.term = None + self.renew = None + self.renew_source = None + self.utilization = None + + +class ReservationPropertyUtilization(msrest.serialization.Model): + """Reservation utilization. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trend: The number of days trend for a reservation. + :vartype trend: str + :param aggregates: The array of aggregates of a reservation's utilization. + :type aggregates: list[~azure.mgmt.billing.models.ReservationUtilizationAggregates] + """ + + _validation = { + 'trend': {'readonly': True}, + } + + _attribute_map = { + 'trend': {'key': 'trend', 'type': 'str'}, + 'aggregates': {'key': 'aggregates', 'type': '[ReservationUtilizationAggregates]'}, + } + + def __init__( + self, + *, + aggregates: Optional[List["ReservationUtilizationAggregates"]] = None, + **kwargs + ): + super(ReservationPropertyUtilization, self).__init__(**kwargs) + self.trend = None + self.aggregates = aggregates + + +class ReservationSkuProperty(msrest.serialization.Model): + """The property of reservation sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the reservation sku. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSkuProperty, self).__init__(**kwargs) + self.name = None + + +class ReservationsListResult(msrest.serialization.Model): + """The list of reservations and summary of roll out count of reservations in each state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservations. + :vartype value: list[~azure.mgmt.billing.models.Reservation] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :param summary: The roll out count summary of the reservations. + :type summary: ~azure.mgmt.billing.models.ReservationSummary + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Reservation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'ReservationSummary'}, + } + + def __init__( + self, + *, + summary: Optional["ReservationSummary"] = None, + **kwargs + ): + super(ReservationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + self.summary = summary + + +class ReservationSummary(msrest.serialization.Model): + """The roll up count summary of reservations in each state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar succeeded_count: The number of reservation in Succeeded state. + :vartype succeeded_count: float + :ivar failed_count: The number of reservation in Failed state. + :vartype failed_count: float + :ivar expiring_count: The number of reservation in Expiring state. + :vartype expiring_count: float + :ivar expired_count: The number of reservation in Expired state. + :vartype expired_count: float + :ivar pending_count: The number of reservation in Pending state. + :vartype pending_count: float + :ivar cancelled_count: The number of reservation in Cancelled state. + :vartype cancelled_count: float + """ + + _validation = { + 'succeeded_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'expiring_count': {'readonly': True}, + 'expired_count': {'readonly': True}, + 'pending_count': {'readonly': True}, + 'cancelled_count': {'readonly': True}, + } + + _attribute_map = { + 'succeeded_count': {'key': 'succeededCount', 'type': 'float'}, + 'failed_count': {'key': 'failedCount', 'type': 'float'}, + 'expiring_count': {'key': 'expiringCount', 'type': 'float'}, + 'expired_count': {'key': 'expiredCount', 'type': 'float'}, + 'pending_count': {'key': 'pendingCount', 'type': 'float'}, + 'cancelled_count': {'key': 'cancelledCount', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummary, self).__init__(**kwargs) + self.succeeded_count = None + self.failed_count = None + self.expiring_count = None + self.expired_count = None + self.pending_count = None + self.cancelled_count = None + + +class ReservationUtilizationAggregates(msrest.serialization.Model): + """The aggregate values of reservation utilization. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar grain: The grain of the aggregate. + :vartype grain: float + :ivar grain_unit: The grain unit of the aggregate. + :vartype grain_unit: str + :ivar value: The aggregate value. + :vartype value: float + :ivar value_unit: The aggregate value unit. + :vartype value_unit: str + """ + + _validation = { + 'grain': {'readonly': True}, + 'grain_unit': {'readonly': True}, + 'value': {'readonly': True}, + 'value_unit': {'readonly': True}, + } + + _attribute_map = { + 'grain': {'key': 'grain', 'type': 'float'}, + 'grain_unit': {'key': 'grainUnit', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + 'value_unit': {'key': 'valueUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationUtilizationAggregates, self).__init__(**kwargs) + self.grain = None + self.grain_unit = None + self.value = None + self.value_unit = None + + class Transaction(Resource): """A transaction. @@ -3452,10 +3819,13 @@ class ValidateSubscriptionTransferEligibilityError(msrest.serialization.Model): """Error details of the transfer eligibility validation. :param code: Error code for the product transfer validation. Possible values include: - "InvalidSource", "SubscriptionNotActive", "InsufficientPermissionOnSource", - "InsufficientPermissionOnDestination", "DestinationBillingProfilePastDue", - "SubscriptionTypeNotSupported", "CrossBillingAccountNotAllowed", - "NotAvailableForDestinationMarket". + "BillingAccountInactive", "CrossBillingAccountNotAllowed", "DestinationBillingProfileInactive", + "DestinationBillingProfileNotFound", "DestinationBillingProfilePastDue", + "DestinationInvoiceSectionInactive", "DestinationInvoiceSectionNotFound", + "InsufficientPermissionOnDestination", "InsufficientPermissionOnSource", "InvalidDestination", + "InvalidSource", "MarketplaceNotEnabledOnDestination", "NotAvailableForDestinationMarket", + "ProductInactive", "ProductNotFound", "ProductTypeNotSupported", "SourceBillingProfilePastDue", + "SourceInvoiceSectionInactive", "SubscriptionNotActive", "SubscriptionTypeNotSupported". :type code: str or ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode :param message: The error message. :type message: str diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 34c9bbb22429..7f7bbc76fedb 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -24,6 +24,7 @@ from ._billing_role_definitions_operations import BillingRoleDefinitionsOperations from ._billing_role_assignments_operations import BillingRoleAssignmentsOperations from ._agreements_operations import AgreementsOperations +from ._reservations_operations import ReservationsOperations from ._enrollment_accounts_operations import EnrollmentAccountsOperations from ._billing_periods_operations import BillingPeriodsOperations @@ -46,6 +47,7 @@ 'BillingRoleDefinitionsOperations', 'BillingRoleAssignmentsOperations', 'AgreementsOperations', + 'ReservationsOperations', 'EnrollmentAccountsOperations', 'BillingPeriodsOperations', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_address_operations.py index 6ea06808697d..57bc172decfd 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_address_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_address_operations.py @@ -90,7 +90,7 @@ def validate( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateAddressResponse', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_agreements_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_agreements_operations.py index 5eeb6a41ee59..50c0ee838512 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_agreements_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_agreements_operations.py @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -174,7 +174,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Agreement', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_available_balances_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_available_balances_operations.py index 6dd989aa105f..6c812855a098 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_available_balances_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_available_balances_operations.py @@ -94,7 +94,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AvailableBalance', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_accounts_operations.py index f648cc4366e5..f16bab94220e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_accounts_operations.py @@ -105,7 +105,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -165,7 +165,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingAccount', pipeline_response) @@ -217,7 +217,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -248,8 +248,8 @@ def begin_update( :type parameters: ~azure.mgmt.billing.models.BillingAccountUpdateRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BillingAccount or the result of cls(response) @@ -361,7 +361,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_periods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_periods_operations.py index 3de505043357..f14d0fb7b717 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_periods_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_periods_operations.py @@ -123,7 +123,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -181,7 +181,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingPeriod', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_permissions_operations.py index 0e4543dc9880..aed9a76bc326 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_permissions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_permissions_operations.py @@ -109,7 +109,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -180,7 +180,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -259,7 +259,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -334,7 +334,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_profiles_operations.py index fcf07d1796f8..355606d61b54 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_profiles_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_profiles_operations.py @@ -113,7 +113,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -178,7 +178,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProfile', pipeline_response) @@ -232,7 +232,7 @@ def _create_or_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -269,8 +269,8 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.billing.models.BillingProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BillingProfile or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_property_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_property_operations.py index 619acea4e25c..27b207d37848 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_property_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_property_operations.py @@ -86,7 +86,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProperty', pipeline_response) @@ -149,7 +149,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingProperty', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_assignments_operations.py index 72a3d876ee0d..3ab2113a6808 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_assignments_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_assignments_operations.py @@ -95,7 +95,7 @@ def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -156,7 +156,7 @@ def delete_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -224,7 +224,7 @@ def get_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -292,7 +292,7 @@ def delete_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -357,7 +357,7 @@ def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -422,7 +422,7 @@ def delete_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleAssignment', pipeline_response) @@ -495,7 +495,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -575,7 +575,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -651,7 +651,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_definitions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_definitions_operations.py index f1f9ccae734d..1c6ebe650d73 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_definitions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_role_definitions_operations.py @@ -94,7 +94,7 @@ def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -162,7 +162,7 @@ def get_by_invoice_section( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -226,7 +226,7 @@ def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingRoleDefinition', pipeline_response) @@ -298,7 +298,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -378,7 +378,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -454,7 +454,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_subscriptions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_subscriptions_operations.py index 633cd7140175..1e437388e858 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_subscriptions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_billing_subscriptions_operations.py @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -184,7 +184,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -261,7 +261,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -341,7 +341,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -398,7 +398,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingSubscription', pipeline_response) @@ -465,7 +465,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BillingSubscription', pipeline_response) @@ -518,7 +518,7 @@ def _move_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -553,8 +553,8 @@ def begin_move( :type parameters: ~azure.mgmt.billing.models.TransferBillingSubscriptionRequestProperties :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BillingSubscription or the result of cls(response) @@ -660,7 +660,7 @@ def validate_move( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateSubscriptionTransferEligibilityResult', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_customers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_customers_operations.py index caea83ebe739..5e112bddbaec 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_customers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_customers_operations.py @@ -121,7 +121,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -204,7 +204,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -269,7 +269,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Customer', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_enrollment_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_enrollment_accounts_operations.py index 1ae07c3744ae..36a5e9836b06 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_enrollment_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_enrollment_accounts_operations.py @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -153,7 +153,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EnrollmentAccountSummary', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_instructions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_instructions_operations.py index db31bda2868c..3b7a277eb67a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_instructions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_instructions_operations.py @@ -109,7 +109,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -173,7 +173,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Instruction', pipeline_response) @@ -245,7 +245,7 @@ def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Instruction', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoice_sections_operations.py index 98945e458a35..5a5af73619bd 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoice_sections_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoice_sections_operations.py @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -176,7 +176,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('InvoiceSection', pipeline_response) @@ -232,7 +232,7 @@ def _create_or_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -272,8 +272,8 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.billing.models.InvoiceSection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either InvoiceSection or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py index 89e4159386d6..4949075cee12 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py @@ -64,8 +64,8 @@ def list_by_billing_account( :param period_start_date: The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. :type period_start_date: str - :param period_end_date: The end date to fetch the invoices. The date should be specified in MM- - DD-YYYY format. + :param period_end_date: The end date to fetch the invoices. The date should be specified in + MM-DD-YYYY format. :type period_end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either InvoiceListResult or the result of cls(response) @@ -119,7 +119,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -150,8 +150,8 @@ def list_by_billing_profile( :param period_start_date: The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. :type period_start_date: str - :param period_end_date: The end date to fetch the invoices. The date should be specified in MM- - DD-YYYY format. + :param period_end_date: The end date to fetch the invoices. The date should be specified in + MM-DD-YYYY format. :type period_end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either InvoiceListResult or the result of cls(response) @@ -206,7 +206,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -266,7 +266,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -322,7 +322,7 @@ def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -372,7 +372,7 @@ def _download_invoice_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -409,8 +409,8 @@ def begin_download_invoice( :type download_token: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DownloadUrl or the result of cls(response) @@ -503,7 +503,7 @@ def _download_multiple_billing_profile_invoices_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -538,8 +538,8 @@ def begin_download_multiple_billing_profile_invoices( :type download_urls: list[str] :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DownloadUrl or the result of cls(response) @@ -654,7 +654,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -710,7 +710,7 @@ def get_by_subscription_and_invoice_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invoice', pipeline_response) @@ -759,7 +759,7 @@ def _download_billing_subscription_invoice_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -792,8 +792,8 @@ def begin_download_billing_subscription_invoice( :type download_token: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DownloadUrl or the result of cls(response) @@ -884,7 +884,7 @@ def _download_multiple_billing_subscription_invoices_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -915,8 +915,8 @@ def begin_download_multiple_billing_subscription_invoices( :type download_urls: list[str] :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DownloadUrl or the result of cls(response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_operations.py index 891d77ba3302..643a38021450 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_operations.py @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_policies_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_policies_operations.py index ae82c7d4b984..d347885b4814 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_policies_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_policies_operations.py @@ -93,7 +93,7 @@ def get_by_billing_profile( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Policy', pipeline_response) @@ -161,7 +161,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Policy', pipeline_response) @@ -221,7 +221,7 @@ def get_by_customer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomerPolicy', pipeline_response) @@ -289,7 +289,7 @@ def update_customer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomerPolicy', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_products_operations.py index 764a3defafcc..6b08ee6d89a3 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_products_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_products_operations.py @@ -111,7 +111,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -191,7 +191,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -275,7 +275,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -363,7 +363,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -423,7 +423,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Product', pipeline_response) @@ -491,7 +491,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Product', pipeline_response) @@ -561,7 +561,7 @@ def move( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -638,7 +638,7 @@ def validate_move( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateProductTransferEligibilityResult', pipeline_response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py new file mode 100644 index 000000000000..3bb4d1c96b1e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py @@ -0,0 +1,238 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsOperations(object): + """ReservationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.billing.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_billing_account( + self, + billing_account_name, # type: str + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] + refresh_summary=None, # type: Optional[str] + selected_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ReservationsListResult"] + """Lists the reservations for a billing account and the roll up counts of reservations group by + provisioning states. + + :param billing_account_name: The ID that uniquely identifies a billing account. + :type billing_account_name: str + :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', + and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up counts of the reservations + group by provisioning states. + :type refresh_summary: str + :param selected_state: The selected provisioning state. + :type selected_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.billing.models.ReservationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ReservationsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations'} # type: ignore + + def list_by_billing_profile( + self, + billing_account_name, # type: str + billing_profile_name, # type: str + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] + refresh_summary=None, # type: Optional[str] + selected_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ReservationsListResult"] + """Lists the reservations for a billing profile and the roll up counts of reservations group by + provisioning state. + + :param billing_account_name: The ID that uniquely identifies a billing account. + :type billing_account_name: str + :param billing_profile_name: The ID that uniquely identifies a billing profile. + :type billing_profile_name: str + :param filter: May be used to filter by reservation properties. The filter supports 'eq', 'or', + and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up counts of the reservations + group by provisioning state. + :type refresh_summary: str + :param selected_state: The selected provisioning state. + :type selected_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.billing.models.ReservationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ReservationsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations'} # type: ignore diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_transactions_operations.py index 8eda42e3891e..4eb99fe2bdb8 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_transactions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_transactions_operations.py @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)