diff --git a/sdk/support/azure-mgmt-support/_meta.json b/sdk/support/azure-mgmt-support/_meta.json index ebfe2dc6b38c..e398e6530176 100644 --- a/sdk/support/azure-mgmt-support/_meta.json +++ b/sdk/support/azure-mgmt-support/_meta.json @@ -1,11 +1,11 @@ { - "commit": "665e7c3b6f26b148b3c05e55602621bc293cc0a4", + "commit": "d409622c9a7e5777cf2b14f94544b8a6c5b97e9e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.13.16", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/support/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/support/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/support/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/_configuration.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/_configuration.py index 9f873d76f422..50ef5c20756b 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/_configuration.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/_configuration.py @@ -28,13 +28,13 @@ class MicrosoftSupportConfiguration: # pylint: disable=too-many-instance-attrib :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2023-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/_microsoft_support.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/_microsoft_support.py index 5a49fb8ca3bf..c9e0e8fd5562 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/_microsoft_support.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/_microsoft_support.py @@ -26,8 +26,12 @@ FileWorkspacesOperations, FilesNoSubscriptionOperations, FilesOperations, + LookUpResourceIdOperations, Operations, + ProblemClassificationsNoSubscriptionOperations, ProblemClassificationsOperations, + ServiceClassificationsNoSubscriptionOperations, + ServiceClassificationsOperations, ServicesOperations, SupportTicketsNoSubscriptionOperations, SupportTicketsOperations, @@ -45,6 +49,17 @@ class MicrosoftSupport: # pylint: disable=client-accepts-api-version-keyword,to :vartype operations: azure.mgmt.support.operations.Operations :ivar services: ServicesOperations operations :vartype services: azure.mgmt.support.operations.ServicesOperations + :ivar service_classifications_no_subscription: ServiceClassificationsNoSubscriptionOperations + operations + :vartype service_classifications_no_subscription: + azure.mgmt.support.operations.ServiceClassificationsNoSubscriptionOperations + :ivar service_classifications: ServiceClassificationsOperations operations + :vartype service_classifications: + azure.mgmt.support.operations.ServiceClassificationsOperations + :ivar problem_classifications_no_subscription: ProblemClassificationsNoSubscriptionOperations + operations + :vartype problem_classifications_no_subscription: + azure.mgmt.support.operations.ProblemClassificationsNoSubscriptionOperations :ivar problem_classifications: ProblemClassificationsOperations operations :vartype problem_classifications: azure.mgmt.support.operations.ProblemClassificationsOperations @@ -72,14 +87,16 @@ class MicrosoftSupport: # pylint: disable=client-accepts-api-version-keyword,to :vartype files: azure.mgmt.support.operations.FilesOperations :ivar files_no_subscription: FilesNoSubscriptionOperations operations :vartype files_no_subscription: azure.mgmt.support.operations.FilesNoSubscriptionOperations + :ivar look_up_resource_id: LookUpResourceIdOperations operations + :vartype look_up_resource_id: azure.mgmt.support.operations.LookUpResourceIdOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -119,6 +136,15 @@ def __init__( self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.service_classifications_no_subscription = ServiceClassificationsNoSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.service_classifications = ServiceClassificationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.problem_classifications_no_subscription = ProblemClassificationsNoSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.problem_classifications = ProblemClassificationsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -144,6 +170,9 @@ def __init__( self.files_no_subscription = FilesNoSubscriptionOperations( self._client, self._config, self._serialize, self._deserialize ) + self.look_up_resource_id = LookUpResourceIdOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/_version.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/_version.py index 364f3c906cf9..e5754a47ce68 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/_version.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_configuration.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_configuration.py index 7e2315ec2c70..4cc8a6917847 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_configuration.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_configuration.py @@ -28,13 +28,13 @@ class MicrosoftSupportConfiguration: # pylint: disable=too-many-instance-attrib :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2023-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_microsoft_support.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_microsoft_support.py index 2c4642859e08..19eb33514e71 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_microsoft_support.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/_microsoft_support.py @@ -26,8 +26,12 @@ FileWorkspacesOperations, FilesNoSubscriptionOperations, FilesOperations, + LookUpResourceIdOperations, Operations, + ProblemClassificationsNoSubscriptionOperations, ProblemClassificationsOperations, + ServiceClassificationsNoSubscriptionOperations, + ServiceClassificationsOperations, ServicesOperations, SupportTicketsNoSubscriptionOperations, SupportTicketsOperations, @@ -45,6 +49,17 @@ class MicrosoftSupport: # pylint: disable=client-accepts-api-version-keyword,to :vartype operations: azure.mgmt.support.aio.operations.Operations :ivar services: ServicesOperations operations :vartype services: azure.mgmt.support.aio.operations.ServicesOperations + :ivar service_classifications_no_subscription: ServiceClassificationsNoSubscriptionOperations + operations + :vartype service_classifications_no_subscription: + azure.mgmt.support.aio.operations.ServiceClassificationsNoSubscriptionOperations + :ivar service_classifications: ServiceClassificationsOperations operations + :vartype service_classifications: + azure.mgmt.support.aio.operations.ServiceClassificationsOperations + :ivar problem_classifications_no_subscription: ProblemClassificationsNoSubscriptionOperations + operations + :vartype problem_classifications_no_subscription: + azure.mgmt.support.aio.operations.ProblemClassificationsNoSubscriptionOperations :ivar problem_classifications: ProblemClassificationsOperations operations :vartype problem_classifications: azure.mgmt.support.aio.operations.ProblemClassificationsOperations @@ -72,14 +87,16 @@ class MicrosoftSupport: # pylint: disable=client-accepts-api-version-keyword,to :vartype files: azure.mgmt.support.aio.operations.FilesOperations :ivar files_no_subscription: FilesNoSubscriptionOperations operations :vartype files_no_subscription: azure.mgmt.support.aio.operations.FilesNoSubscriptionOperations + :ivar look_up_resource_id: LookUpResourceIdOperations operations + :vartype look_up_resource_id: azure.mgmt.support.aio.operations.LookUpResourceIdOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -119,6 +136,15 @@ def __init__( self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.service_classifications_no_subscription = ServiceClassificationsNoSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.service_classifications = ServiceClassificationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.problem_classifications_no_subscription = ProblemClassificationsNoSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.problem_classifications = ProblemClassificationsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -144,6 +170,9 @@ def __init__( self.files_no_subscription = FilesNoSubscriptionOperations( self._client, self._config, self._serialize, self._deserialize ) + self.look_up_resource_id = LookUpResourceIdOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/__init__.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/__init__.py index 7700443bd45e..e6dfd621f375 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/__init__.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/__init__.py @@ -8,6 +8,9 @@ from ._operations import Operations from ._services_operations import ServicesOperations +from ._service_classifications_no_subscription_operations import ServiceClassificationsNoSubscriptionOperations +from ._service_classifications_operations import ServiceClassificationsOperations +from ._problem_classifications_no_subscription_operations import ProblemClassificationsNoSubscriptionOperations from ._problem_classifications_operations import ProblemClassificationsOperations from ._support_tickets_operations import SupportTicketsOperations from ._support_tickets_no_subscription_operations import SupportTicketsNoSubscriptionOperations @@ -19,6 +22,7 @@ from ._file_workspaces_no_subscription_operations import FileWorkspacesNoSubscriptionOperations from ._files_operations import FilesOperations from ._files_no_subscription_operations import FilesNoSubscriptionOperations +from ._look_up_resource_id_operations import LookUpResourceIdOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -27,6 +31,9 @@ __all__ = [ "Operations", "ServicesOperations", + "ServiceClassificationsNoSubscriptionOperations", + "ServiceClassificationsOperations", + "ProblemClassificationsNoSubscriptionOperations", "ProblemClassificationsOperations", "SupportTicketsOperations", "SupportTicketsNoSubscriptionOperations", @@ -38,6 +45,7 @@ "FileWorkspacesNoSubscriptionOperations", "FilesOperations", "FilesNoSubscriptionOperations", + "LookUpResourceIdOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_no_subscription_operations.py index 755d72d51c69..0fd268abc060 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_no_subscription_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._chat_transcripts_no_subscription_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ def list(self, support_ticket_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChatTranscriptsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +153,7 @@ async def get( :rtype: ~azure.mgmt.support.models.ChatTranscriptDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_operations.py index 3edc30641c9b..e97ddf58488a 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_chat_transcripts_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._chat_transcripts_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ def list(self, support_ticket_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChatTranscriptsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +154,7 @@ async def get( :rtype: ~azure.mgmt.support.models.ChatTranscriptDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_no_subscription_operations.py index 4cf8c6427c3b..9e1872a02c5b 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -129,7 +134,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +195,7 @@ def list( """Lists all communications (attachments not included) for a support ticket. :code:`
`
You can also filter support ticket communications by *CreatedDate* or *CommunicationType* using the $filter parameter. The only type of communication supported today is *Web*. Output will be - a paged result with *nextLink*\ , using which you can retrieve the next set of Communication + a paged result with *nextLink*\\ , using which you can retrieve the next set of Communication results. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -218,7 +223,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CommunicationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ async def get( :rtype: ~azure.mgmt.support.models.CommunicationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def _create_initial( create_communication_parameters: Union[_models.CommunicationDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.CommunicationDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_operations.py index 3e7cb58c22f6..45678d8b49a8 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_communications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -129,7 +134,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +196,7 @@ def list( """Lists all communications (attachments not included) for a support ticket. :code:`
`
You can also filter support ticket communications by *CreatedDate* or *CommunicationType* using the $filter parameter. The only type of communication supported today is *Web*. Output will be - a paged result with *nextLink*\ , using which you can retrieve the next set of Communication + a paged result with *nextLink*\\ , using which you can retrieve the next set of Communication results. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -219,7 +224,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CommunicationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def get( :rtype: ~azure.mgmt.support.models.CommunicationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +355,7 @@ async def _create_initial( create_communication_parameters: Union[_models.CommunicationDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.CommunicationDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_no_subscription_operations.py index 783df934f0c6..7177af533074 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_no_subscription_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._file_workspaces_no_subscription_operations import build_create_request, build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def get(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWork :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +117,7 @@ async def create(self, file_workspace_name: str, **kwargs: Any) -> _models.FileW :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_operations.py index 4294736acf51..e4cd56e5266a 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_file_workspaces_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._file_workspaces_operations import build_create_request, build_get_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +65,7 @@ async def get(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWork :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +118,7 @@ async def create(self, file_workspace_name: str, **kwargs: Any) -> _models.FileW :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_no_subscription_operations.py index 316fbe98d52f..ae7fed21ff5f 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_upload_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list(self, file_workspace_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FilesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +155,7 @@ async def get(self, file_workspace_name: str, file_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +271,7 @@ async def create( :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def upload( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_operations.py index a074dec56bdb..da220fc9bb2b 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_files_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_upload_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +80,7 @@ def list(self, file_workspace_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FilesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +156,7 @@ async def get(self, file_workspace_name: str, file_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +273,7 @@ async def create( :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +398,7 @@ async def upload( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_look_up_resource_id_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_look_up_resource_id_operations.py new file mode 100644 index 000000000000..d1d91f4626a5 --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_look_up_resource_id_operations.py @@ -0,0 +1,166 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._look_up_resource_id_operations import build_post_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class LookUpResourceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.aio.MicrosoftSupport`'s + :attr:`look_up_resource_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def post( + self, + look_up_resource_id_request: _models.LookUpResourceIdRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Required. + :type look_up_resource_id_request: ~azure.mgmt.support.models.LookUpResourceIdRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, look_up_resource_id_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Required. + :type look_up_resource_id_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def post( + self, look_up_resource_id_request: Union[_models.LookUpResourceIdRequest, IO[bytes]], **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Is either a + LookUpResourceIdRequest type or a IO[bytes] type. Required. + :type look_up_resource_id_request: ~azure.mgmt.support.models.LookUpResourceIdRequest or + IO[bytes] + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LookUpResourceIdResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(look_up_resource_id_request, (IOBase, bytes)): + _content = look_up_resource_id_request + else: + _json = self._serialize.body(look_up_resource_id_request, "LookUpResourceIdRequest") + + _request = build_post_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LookUpResourceIdResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_operations.py index f35fe0803df8..7ccdd661f58b 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_no_subscription_operations.py new file mode 100644 index 000000000000..1aef9fb09db2 --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_no_subscription_operations.py @@ -0,0 +1,184 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._problem_classifications_no_subscription_operations import build_classify_problems_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ProblemClassificationsNoSubscriptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.aio.MicrosoftSupport`'s + :attr:`problem_classifications_no_subscription` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: _models.ProblemClassificationsClassificationInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: Union[ + _models.ProblemClassificationsClassificationInput, IO[bytes] + ], + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Is either a + ProblemClassificationsClassificationInput type or a IO[bytes] type. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput or IO[bytes] + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProblemClassificationsClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(problem_classifications_classification_input, (IOBase, bytes)): + _content = problem_classifications_classification_input + else: + _json = self._serialize.body( + problem_classifications_classification_input, "ProblemClassificationsClassificationInput" + ) + + _request = build_classify_problems_request( + problem_service_name=problem_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ProblemClassificationsClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_operations.py index b950a8ec3f27..f38c162dbbb3 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_problem_classifications_operations.py @@ -6,7 +6,9 @@ # 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, Optional, TypeVar +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -28,8 +30,16 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._problem_classifications_operations import build_get_request, build_list_request +from ...operations._problem_classifications_operations import ( + build_classify_problems_request, + build_get_request, + build_list_request, +) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,6 +63,134 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: _models.ProblemClassificationsClassificationInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: Union[ + _models.ProblemClassificationsClassificationInput, IO[bytes] + ], + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Is either a + ProblemClassificationsClassificationInput type or a IO[bytes] type. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput or IO[bytes] + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProblemClassificationsClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(problem_classifications_classification_input, (IOBase, bytes)): + _content = problem_classifications_classification_input + else: + _json = self._serialize.body( + problem_classifications_classification_input, "ProblemClassificationsClassificationInput" + ) + + _request = build_classify_problems_request( + problem_service_name=problem_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ProblemClassificationsClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace def list(self, service_name: str, **kwargs: Any) -> AsyncIterable["_models.ProblemClassification"]: """Lists all the problem classifications (categories) available for a specific Azure service. @@ -74,7 +212,7 @@ def list(self, service_name: str, **kwargs: Any) -> AsyncIterable["_models.Probl api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProblemClassificationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +281,8 @@ async def get( ) -> _models.ProblemClassification: """Get problem classification details for a specific Azure service. - :param service_name: Name of the Azure service available for support. Required. + :param service_name: Name of the Azure service for which the problem classifications need to be + retrieved. Required. :type service_name: str :param problem_classification_name: Name of problem classification. Required. :type problem_classification_name: str @@ -151,7 +290,7 @@ async def get( :rtype: ~azure.mgmt.support.models.ProblemClassification :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_no_subscription_operations.py new file mode 100644 index 000000000000..d767c1e46dfd --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_no_subscription_operations.py @@ -0,0 +1,160 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._service_classifications_no_subscription_operations import build_classify_services_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServiceClassificationsNoSubscriptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.aio.MicrosoftSupport`'s + :attr:`service_classifications_no_subscription` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def classify_services( + self, + service_classification_request: _models.ServiceClassificationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def classify_services( + self, service_classification_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def classify_services( + self, service_classification_request: Union[_models.ServiceClassificationRequest, IO[bytes]], **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Is either a ServiceClassificationRequest + type or a IO[bytes] type. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + or IO[bytes] + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_classification_request, (IOBase, bytes)): + _content = service_classification_request + else: + _json = self._serialize.body(service_classification_request, "ServiceClassificationRequest") + + _request = build_classify_services_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_operations.py new file mode 100644 index 000000000000..296616fb332a --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_service_classifications_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._service_classifications_operations import build_classify_services_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServiceClassificationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.aio.MicrosoftSupport`'s + :attr:`service_classifications` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def classify_services( + self, + service_classification_request: _models.ServiceClassificationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def classify_services( + self, service_classification_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def classify_services( + self, service_classification_request: Union[_models.ServiceClassificationRequest, IO[bytes]], **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Is either a ServiceClassificationRequest + type or a IO[bytes] type. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + or IO[bytes] + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_classification_request, (IOBase, bytes)): + _content = service_classification_request + else: + _json = self._serialize.body(service_classification_request, "ServiceClassificationRequest") + + _request = build_classify_services_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_services_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_services_operations.py index 9a2d4cbbc3d6..33ac03a13723 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_services_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_services_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._services_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +78,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Service"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -139,13 +144,14 @@ async def get_next(next_link=None): async def get(self, service_name: str, **kwargs: Any) -> _models.Service: """Gets a specific Azure service for support ticket creation. - :param service_name: Name of the Azure service. Required. + :param service_name: Name of the Azure service for which the problem classifications need to be + retrieved. Required. :type service_name: str :return: Service or the result of cls(response) :rtype: ~azure.mgmt.support.models.Service :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_no_subscription_operations.py index 62a9209d7068..ce548c0c91aa 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -115,7 +120,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -203,7 +208,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportTicketsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +284,7 @@ async def get(self, support_ticket_name: str, **kwargs: Any) -> _models.SupportT :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ async def update( :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ async def _create_initial( create_support_ticket_parameters: Union[_models.SupportTicketDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.SupportTicketDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_operations.py index 2ac02397efcd..1b6e56d4f4da 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/aio/operations/_support_tickets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -115,7 +120,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,8 +179,8 @@ def list( self, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.SupportTicketDetails"]: """Lists all the support tickets for an Azure subscription. You can also filter the support - tickets by *Status*\ , *CreatedDate*\ , *ServiceId*\ , and *ProblemClassificationId* using the - $filter parameter. Output will be a paged result with *nextLink*\ , using which you can + tickets by *Status*\\ , *CreatedDate*\\ , *ServiceId*\\ , and *ProblemClassificationId* using + the $filter parameter. Output will be a paged result with *nextLink*\\ , using which you can retrieve the next set of support tickets. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -184,8 +189,8 @@ def list( Default value is None. :type top: int :param filter: The filter to apply on the operation. We support 'odata v4.0' filter semantics. - `Learn more `_. *Status*\ , - *ServiceId*\ , and *ProblemClassificationId* filters can only be used with Equals ('eq') + `Learn more `_. *Status*\\ , + *ServiceId*\\ , and *ProblemClassificationId* filters can only be used with Equals ('eq') operator. For *CreatedDate* filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. Default value is None. @@ -202,7 +207,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportTicketsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +284,7 @@ async def get(self, support_ticket_name: str, **kwargs: Any) -> _models.SupportT :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +403,7 @@ async def update( :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def _create_initial( create_support_ticket_parameters: Union[_models.SupportTicketDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.SupportTicketDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,8 +542,8 @@ async def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the @@ -579,8 +584,8 @@ async def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the @@ -619,8 +624,8 @@ async def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/models/__init__.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/models/__init__.py index 57c65d599461..8403052a5398 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/models/__init__.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/models/__init__.py @@ -10,6 +10,7 @@ from ._models_py3 import ChatTranscriptsListResult from ._models_py3 import CheckNameAvailabilityInput from ._models_py3 import CheckNameAvailabilityOutput +from ._models_py3 import ClassificationService from ._models_py3 import CommunicationDetails from ._models_py3 import CommunicationsListResult from ._models_py3 import ContactProfile @@ -19,11 +20,16 @@ from ._models_py3 import FileDetails from ._models_py3 import FileWorkspaceDetails from ._models_py3 import FilesListResult +from ._models_py3 import LookUpResourceIdRequest +from ._models_py3 import LookUpResourceIdResponse from ._models_py3 import MessageProperties from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationsListResult from ._models_py3 import ProblemClassification +from ._models_py3 import ProblemClassificationsClassificationInput +from ._models_py3 import ProblemClassificationsClassificationOutput +from ._models_py3 import ProblemClassificationsClassificationResult from ._models_py3 import ProblemClassificationsListResult from ._models_py3 import ProxyResource from ._models_py3 import QuotaChangeRequest @@ -32,6 +38,9 @@ from ._models_py3 import SecondaryConsent from ._models_py3 import SecondaryConsentEnabled from ._models_py3 import Service +from ._models_py3 import ServiceClassificationAnswer +from ._models_py3 import ServiceClassificationOutput +from ._models_py3 import ServiceClassificationRequest from ._models_py3 import ServiceLevelAgreement from ._models_py3 import ServicesListResult from ._models_py3 import SupportEngineer @@ -63,6 +72,7 @@ "ChatTranscriptsListResult", "CheckNameAvailabilityInput", "CheckNameAvailabilityOutput", + "ClassificationService", "CommunicationDetails", "CommunicationsListResult", "ContactProfile", @@ -72,11 +82,16 @@ "FileDetails", "FileWorkspaceDetails", "FilesListResult", + "LookUpResourceIdRequest", + "LookUpResourceIdResponse", "MessageProperties", "Operation", "OperationDisplay", "OperationsListResult", "ProblemClassification", + "ProblemClassificationsClassificationInput", + "ProblemClassificationsClassificationOutput", + "ProblemClassificationsClassificationResult", "ProblemClassificationsListResult", "ProxyResource", "QuotaChangeRequest", @@ -85,6 +100,9 @@ "SecondaryConsent", "SecondaryConsentEnabled", "Service", + "ServiceClassificationAnswer", + "ServiceClassificationOutput", + "ServiceClassificationRequest", "ServiceLevelAgreement", "ServicesListResult", "SupportEngineer", diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/models/_models_py3.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/models/_models_py3.py index cb92810f43f2..c6debb02b77c 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/models/_models_py3.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, List, Optional, TYPE_CHECKING, Union +from typing import Any, List, Literal, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -227,13 +227,46 @@ def __init__(self, **kwargs: Any) -> None: self.message = None +class ClassificationService(_serialization.Model): + """Service Classification result object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_id: Azure resource Id of the service. + :vartype service_id: str + :ivar display_name: Localized name of the azure service. + :vartype display_name: str + :ivar resource_types: List of applicable ARM resource types for this service. + :vartype resource_types: list[str] + """ + + _validation = { + "service_id": {"readonly": True}, + "display_name": {"readonly": True}, + } + + _attribute_map = { + "service_id": {"key": "serviceId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "resource_types": {"key": "resourceTypes", "type": "[str]"}, + } + + def __init__(self, *, resource_types: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword resource_types: List of applicable ARM resource types for this service. + :paramtype resource_types: list[str] + """ + super().__init__(**kwargs) + self.service_id = None + self.display_name = None + self.resource_types = resource_types + + class CommunicationDetails(_serialization.Model): """Object that represents a Communication resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar id: Id of the resource. :vartype id: str :ivar name: Name of the resource. @@ -248,9 +281,9 @@ class CommunicationDetails(_serialization.Model): :ivar sender: Email address of the sender. This property is required if called by a service principal. :vartype sender: str - :ivar subject: Subject of the communication. Required. + :ivar subject: Subject of the communication. :vartype subject: str - :ivar body: Body of the communication. Required. + :ivar body: Body of the communication. :vartype body: str :ivar created_date: Time in UTC (ISO 8601 format) when the communication was created. :vartype created_date: ~datetime.datetime @@ -262,8 +295,6 @@ class CommunicationDetails(_serialization.Model): "type": {"readonly": True}, "communication_type": {"readonly": True}, "communication_direction": {"readonly": True}, - "subject": {"required": True}, - "body": {"required": True}, "created_date": {"readonly": True}, } @@ -279,14 +310,16 @@ class CommunicationDetails(_serialization.Model): "created_date": {"key": "properties.createdDate", "type": "iso-8601"}, } - def __init__(self, *, subject: str, body: str, sender: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, sender: Optional[str] = None, subject: Optional[str] = None, body: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword sender: Email address of the sender. This property is required if called by a service principal. :paramtype sender: str - :keyword subject: Subject of the communication. Required. + :keyword subject: Subject of the communication. :paramtype subject: str - :keyword body: Body of the communication. Required. + :keyword body: Body of the communication. :paramtype body: str """ super().__init__(**kwargs) @@ -556,14 +589,11 @@ class FileDetails(ProxyResource): :vartype system_data: ~azure.mgmt.support.models.SystemData :ivar created_on: Time in UTC (ISO 8601 format) when file workspace was created. :vartype created_on: ~datetime.datetime - :ivar chunk_size: Size of each chunk. The size of each chunk should be provided in bytes and - must not exceed 2.5 megabytes (MB). + :ivar chunk_size: Size of each chunk. :vartype chunk_size: int - :ivar file_size: Size of the file to be uploaded. The file size must not exceed 5 MB and should - be provided in bytes. + :ivar file_size: Size of the file to be uploaded. :vartype file_size: int - :ivar number_of_chunks: Number of chunks to be uploaded. The maximum number of allowed chunks - is 2. + :ivar number_of_chunks: Number of chunks to be uploaded. :vartype number_of_chunks: int """ @@ -595,14 +625,11 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword chunk_size: Size of each chunk. The size of each chunk should be provided in bytes and - must not exceed 2.5 megabytes (MB). + :keyword chunk_size: Size of each chunk. :paramtype chunk_size: int - :keyword file_size: Size of the file to be uploaded. The file size must not exceed 5 MB and - should be provided in bytes. + :keyword file_size: Size of the file to be uploaded. :paramtype file_size: int - :keyword number_of_chunks: Number of chunks to be uploaded. The maximum number of allowed - chunks is 2. + :keyword number_of_chunks: Number of chunks to be uploaded. :paramtype number_of_chunks: int """ super().__init__(**kwargs) @@ -687,11 +714,67 @@ def __init__(self, **kwargs: Any) -> None: self.expiration_time = None +class LookUpResourceIdRequest(_serialization.Model): + """The look up resource Id request body. + + :ivar identifier: The System generated Id that is unique. Use supportTicketId property for + Microsoft.Support/supportTickets resource type. + :vartype identifier: str + :ivar type: The type of resource. Default value is "Microsoft.Support/supportTickets". + :vartype type: str + """ + + _attribute_map = { + "identifier": {"key": "identifier", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + identifier: Optional[str] = None, + type: Optional[Literal["Microsoft.Support/supportTickets"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword identifier: The System generated Id that is unique. Use supportTicketId property for + Microsoft.Support/supportTickets resource type. + :paramtype identifier: str + :keyword type: The type of resource. Default value is "Microsoft.Support/supportTickets". + :paramtype type: str + """ + super().__init__(**kwargs) + self.identifier = identifier + self.type = type + + +class LookUpResourceIdResponse(_serialization.Model): + """The look up resource id response. + + :ivar resource_id: The resource Id of support resource type. + :vartype resource_id: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword resource_id: The resource Id of support resource type. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + class MessageProperties(_serialization.Model): """Describes the properties of a Message Details resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. + :ivar content_type: Content type. :vartype content_type: str or ~azure.mgmt.support.models.TranscriptContentType :ivar communication_direction: Direction of communication. Known values are: "inbound" and @@ -699,7 +782,7 @@ class MessageProperties(_serialization.Model): :vartype communication_direction: str or ~azure.mgmt.support.models.CommunicationDirection :ivar sender: Name of the sender. :vartype sender: str - :ivar body: Body of the communication. + :ivar body: Body of the communication. Required. :vartype body: str :ivar created_date: Time in UTC (ISO 8601 format) when the communication was created. :vartype created_date: ~datetime.datetime @@ -708,6 +791,7 @@ class MessageProperties(_serialization.Model): _validation = { "content_type": {"readonly": True}, "communication_direction": {"readonly": True}, + "body": {"required": True}, "created_date": {"readonly": True}, } @@ -719,11 +803,11 @@ class MessageProperties(_serialization.Model): "created_date": {"key": "createdDate", "type": "iso-8601"}, } - def __init__(self, *, sender: Optional[str] = None, body: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, body: str, sender: Optional[str] = None, **kwargs: Any) -> None: """ :keyword sender: Name of the sender. :paramtype sender: str - :keyword body: Body of the communication. + :keyword body: Body of the communication. Required. :paramtype body: str """ super().__init__(**kwargs) @@ -838,12 +922,18 @@ class ProblemClassification(_serialization.Model): :ivar secondary_consent_enabled: This property indicates whether secondary consent is present for problem classification. :vartype secondary_consent_enabled: list[~azure.mgmt.support.models.SecondaryConsentEnabled] + :ivar metadata: String-to-string dictionary for additional metadata. + :vartype metadata: dict[str, str] + :ivar parent_problem_classification: Reference to the parent problem classification which has + same structure as problem classification. + :vartype parent_problem_classification: ~azure.mgmt.support.models.ProblemClassification """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "metadata": {"readonly": True}, } _attribute_map = { @@ -852,6 +942,11 @@ class ProblemClassification(_serialization.Model): "type": {"key": "type", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "secondary_consent_enabled": {"key": "properties.secondaryConsentEnabled", "type": "[SecondaryConsentEnabled]"}, + "metadata": {"key": "properties.metadata", "type": "{str}"}, + "parent_problem_classification": { + "key": "properties.parentProblemClassification", + "type": "ProblemClassification", + }, } def __init__( @@ -859,6 +954,7 @@ def __init__( *, display_name: Optional[str] = None, secondary_consent_enabled: Optional[List["_models.SecondaryConsentEnabled"]] = None, + parent_problem_classification: Optional["_models.ProblemClassification"] = None, **kwargs: Any ) -> None: """ @@ -867,6 +963,9 @@ def __init__( :keyword secondary_consent_enabled: This property indicates whether secondary consent is present for problem classification. :paramtype secondary_consent_enabled: list[~azure.mgmt.support.models.SecondaryConsentEnabled] + :keyword parent_problem_classification: Reference to the parent problem classification which + has same structure as problem classification. + :paramtype parent_problem_classification: ~azure.mgmt.support.models.ProblemClassification """ super().__init__(**kwargs) self.id = None @@ -874,6 +973,130 @@ def __init__( self.type = None self.display_name = display_name self.secondary_consent_enabled = secondary_consent_enabled + self.metadata = None + self.parent_problem_classification = parent_problem_classification + + +class ProblemClassificationsClassificationInput(_serialization.Model): # pylint: disable=name-too-long + """Input to problem classification Classification API. + + All required parameters must be populated in order to send to server. + + :ivar issue_summary: Natural language description of the customer’s issue. Required. + :vartype issue_summary: str + :ivar resource_id: ARM resource Id of the resource that is having the issue. + :vartype resource_id: str + """ + + _validation = { + "issue_summary": {"required": True}, + } + + _attribute_map = { + "issue_summary": {"key": "issueSummary", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, issue_summary: str, resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword issue_summary: Natural language description of the customer’s issue. Required. + :paramtype issue_summary: str + :keyword resource_id: ARM resource Id of the resource that is having the issue. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.issue_summary = issue_summary + self.resource_id = resource_id + + +class ProblemClassificationsClassificationOutput(_serialization.Model): # pylint: disable=name-too-long + """Output of the problem classification Classification API. + + :ivar problem_classification_results: Set of problem classification objects classified. + :vartype problem_classification_results: + list[~azure.mgmt.support.models.ProblemClassificationsClassificationResult] + """ + + _attribute_map = { + "problem_classification_results": { + "key": "problemClassificationResults", + "type": "[ProblemClassificationsClassificationResult]", + }, + } + + def __init__( + self, + *, + problem_classification_results: Optional[List["_models.ProblemClassificationsClassificationResult"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword problem_classification_results: Set of problem classification objects classified. + :paramtype problem_classification_results: + list[~azure.mgmt.support.models.ProblemClassificationsClassificationResult] + """ + super().__init__(**kwargs) + self.problem_classification_results = problem_classification_results + + +class ProblemClassificationsClassificationResult(_serialization.Model): # pylint: disable=name-too-long + """ProblemClassification Classification result object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar problem_id: Identifier that may be used for solution discovery or some other purposes. + :vartype problem_id: str + :ivar title: Title of the problem classification result. + :vartype title: str + :ivar description: Description of the problem classification result. + :vartype description: str + :ivar service_id: Identifier of the service associated with this problem classification result. + :vartype service_id: str + :ivar problem_classification_id: Identifier that may be used for support ticket creation. + :vartype problem_classification_id: str + :ivar service_id_related_service_id: Azure resource Id of the service. + :vartype service_id_related_service_id: str + :ivar display_name: Localized name of the azure service. + :vartype display_name: str + :ivar resource_types: List of applicable ARM resource types for this service. + :vartype resource_types: list[str] + """ + + _validation = { + "problem_id": {"readonly": True}, + "title": {"readonly": True}, + "description": {"readonly": True}, + "service_id": {"readonly": True}, + "problem_classification_id": {"readonly": True}, + "service_id_related_service_id": {"readonly": True}, + "display_name": {"readonly": True}, + } + + _attribute_map = { + "problem_id": {"key": "problemId", "type": "str"}, + "title": {"key": "title", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "service_id": {"key": "serviceId", "type": "str"}, + "problem_classification_id": {"key": "problemClassificationId", "type": "str"}, + "service_id_related_service_id": {"key": "relatedService.serviceId", "type": "str"}, + "display_name": {"key": "relatedService.displayName", "type": "str"}, + "resource_types": {"key": "relatedService.resourceTypes", "type": "[str]"}, + } + + def __init__(self, *, resource_types: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword resource_types: List of applicable ARM resource types for this service. + :paramtype resource_types: list[str] + """ + super().__init__(**kwargs) + self.problem_id = None + self.title = None + self.description = None + self.service_id = None + self.problem_classification_id = None + self.service_id_related_service_id = None + self.display_name = None + self.resource_types = resource_types class ProblemClassificationsListResult(_serialization.Model): @@ -1042,12 +1265,15 @@ class Service(_serialization.Model): :vartype display_name: str :ivar resource_types: ARM Resource types. :vartype resource_types: list[str] + :ivar metadata: Metadata about the service, only visible for 1P clients. + :vartype metadata: dict[str, str] """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "metadata": {"readonly": True}, } _attribute_map = { @@ -1056,6 +1282,7 @@ class Service(_serialization.Model): "type": {"key": "type", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "resource_types": {"key": "properties.resourceTypes", "type": "[str]"}, + "metadata": {"key": "properties.metadata", "type": "{str}"}, } def __init__( @@ -1073,6 +1300,120 @@ def __init__( self.type = None self.display_name = display_name self.resource_types = resource_types + self.metadata = None + + +class ServiceClassificationAnswer(ClassificationService): + """Service Classification result object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_id: Azure resource Id of the service. + :vartype service_id: str + :ivar display_name: Localized name of the azure service. + :vartype display_name: str + :ivar resource_types: List of applicable ARM resource types for this service. + :vartype resource_types: list[str] + :ivar child_service: Child service. + :vartype child_service: ~azure.mgmt.support.models.ClassificationService + """ + + _validation = { + "service_id": {"readonly": True}, + "display_name": {"readonly": True}, + } + + _attribute_map = { + "service_id": {"key": "serviceId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "resource_types": {"key": "resourceTypes", "type": "[str]"}, + "child_service": {"key": "childService", "type": "ClassificationService"}, + } + + def __init__( + self, + *, + resource_types: Optional[List[str]] = None, + child_service: Optional["_models.ClassificationService"] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_types: List of applicable ARM resource types for this service. + :paramtype resource_types: list[str] + :keyword child_service: Child service. + :paramtype child_service: ~azure.mgmt.support.models.ClassificationService + """ + super().__init__(resource_types=resource_types, **kwargs) + self.child_service = child_service + + +class ServiceClassificationOutput(_serialization.Model): + """Output of the service classification API. + + :ivar service_classification_results: Set of problem classification objects classified. + :vartype service_classification_results: + list[~azure.mgmt.support.models.ServiceClassificationAnswer] + """ + + _attribute_map = { + "service_classification_results": { + "key": "serviceClassificationResults", + "type": "[ServiceClassificationAnswer]", + }, + } + + def __init__( + self, + *, + service_classification_results: Optional[List["_models.ServiceClassificationAnswer"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword service_classification_results: Set of problem classification objects classified. + :paramtype service_classification_results: + list[~azure.mgmt.support.models.ServiceClassificationAnswer] + """ + super().__init__(**kwargs) + self.service_classification_results = service_classification_results + + +class ServiceClassificationRequest(_serialization.Model): + """Input to problem classification Classification API. + + :ivar issue_summary: Natural language description of the customer’s issue. + :vartype issue_summary: str + :ivar resource_id: ARM resource Id of the resource that is having the issue. + :vartype resource_id: str + :ivar additional_context: Additional information in the form of a string. + :vartype additional_context: str + """ + + _attribute_map = { + "issue_summary": {"key": "issueSummary", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "additional_context": {"key": "additionalContext", "type": "str"}, + } + + def __init__( + self, + *, + issue_summary: Optional[str] = None, + resource_id: Optional[str] = None, + additional_context: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword issue_summary: Natural language description of the customer’s issue. + :paramtype issue_summary: str + :keyword resource_id: ARM resource Id of the resource that is having the issue. + :paramtype resource_id: str + :keyword additional_context: Additional information in the form of a string. + :paramtype additional_context: str + """ + super().__init__(**kwargs) + self.issue_summary = issue_summary + self.resource_id = resource_id + self.additional_context = additional_context class ServiceLevelAgreement(_serialization.Model): @@ -1157,8 +1498,6 @@ class SupportTicketDetails(_serialization.Model): # pylint: disable=too-many-in Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar id: Id of the resource. :vartype id: str :ivar name: Name of the resource. @@ -1167,33 +1506,32 @@ class SupportTicketDetails(_serialization.Model): # pylint: disable=too-many-in :vartype type: str :ivar support_ticket_id: System generated support ticket Id that is unique. :vartype support_ticket_id: str - :ivar description: Detailed description of the question or issue. Required. + :ivar description: Detailed description of the question or issue. :vartype description: str :ivar problem_classification_id: Each Azure service has its own set of issue categories, also known as problem classification. This parameter is the unique Id for the type of problem you - are experiencing. Required. + are experiencing. :vartype problem_classification_id: str :ivar problem_classification_display_name: Localized name of problem classification. :vartype problem_classification_display_name: str :ivar severity: A value that indicates the urgency of the case, which in turn determines the response time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also known as the 'Emergency - Severe impact' - level in the Azure portal is reserved only for our Premium customers. Required. Known values - are: "minimal", "moderate", "critical", and "highestcriticalimpact". + level in the Azure portal is reserved only for our Premium customers. Known values are: + "minimal", "moderate", "critical", and "highestcriticalimpact". :vartype severity: str or ~azure.mgmt.support.models.SeverityLevel :ivar enrollment_id: Enrollment Id associated with the support ticket. :vartype enrollment_id: str :ivar require24_x7_response: Indicates if this requires a 24x7 response from Azure. :vartype require24_x7_response: bool :ivar advanced_diagnostic_consent: Advanced diagnostic consent to be updated on the support - ticket. Required. Known values are: "Yes" and "No". + ticket. Known values are: "Yes" and "No". :vartype advanced_diagnostic_consent: str or ~azure.mgmt.support.models.Consent :ivar problem_scoping_questions: Problem scoping questions associated with the support ticket. :vartype problem_scoping_questions: str :ivar support_plan_id: Support plan id associated with the support ticket. :vartype support_plan_id: str :ivar contact_details: Contact information of the user requesting to create a support ticket. - Required. :vartype contact_details: ~azure.mgmt.support.models.ContactProfile :ivar service_level_agreement: Service Level Agreement information for this support ticket. :vartype service_level_agreement: ~azure.mgmt.support.models.ServiceLevelAgreement @@ -1203,12 +1541,12 @@ class SupportTicketDetails(_serialization.Model): # pylint: disable=too-many-in :vartype support_plan_type: str :ivar support_plan_display_name: Support plan type associated with the support ticket. :vartype support_plan_display_name: str - :ivar title: Title of the support ticket. Required. + :ivar title: Title of the support ticket. :vartype title: str :ivar problem_start_time: Time in UTC (ISO 8601 format) when the problem started. :vartype problem_start_time: ~datetime.datetime :ivar service_id: This is the resource Id of the Azure service resource associated with the - support ticket. Required. + support ticket. :vartype service_id: str :ivar service_display_name: Localized name of the Azure service. :vartype service_display_name: str @@ -1237,16 +1575,9 @@ class SupportTicketDetails(_serialization.Model): # pylint: disable=too-many-in "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "description": {"required": True}, - "problem_classification_id": {"required": True}, "problem_classification_display_name": {"readonly": True}, - "severity": {"required": True}, - "advanced_diagnostic_consent": {"required": True}, - "contact_details": {"required": True}, "support_plan_type": {"readonly": True}, "support_plan_display_name": {"readonly": True}, - "title": {"required": True}, - "service_id": {"required": True}, "service_display_name": {"readonly": True}, "status": {"readonly": True}, "created_date": {"readonly": True}, @@ -1290,21 +1621,21 @@ class SupportTicketDetails(_serialization.Model): # pylint: disable=too-many-in def __init__( # pylint: disable=too-many-locals self, *, - description: str, - problem_classification_id: str, - severity: Union[str, "_models.SeverityLevel"], - advanced_diagnostic_consent: Union[str, "_models.Consent"], - contact_details: "_models.ContactProfile", - title: str, - service_id: str, support_ticket_id: Optional[str] = None, + description: Optional[str] = None, + problem_classification_id: Optional[str] = None, + severity: Optional[Union[str, "_models.SeverityLevel"]] = None, enrollment_id: Optional[str] = None, require24_x7_response: Optional[bool] = None, + advanced_diagnostic_consent: Optional[Union[str, "_models.Consent"]] = None, problem_scoping_questions: Optional[str] = None, support_plan_id: Optional[str] = None, + contact_details: Optional["_models.ContactProfile"] = None, service_level_agreement: Optional["_models.ServiceLevelAgreement"] = None, support_engineer: Optional["_models.SupportEngineer"] = None, + title: Optional[str] = None, problem_start_time: Optional[datetime.datetime] = None, + service_id: Optional[str] = None, file_workspace_name: Optional[str] = None, technical_ticket_details: Optional["_models.TechnicalTicketDetails"] = None, quota_ticket_details: Optional["_models.QuotaTicketDetails"] = None, @@ -1314,24 +1645,24 @@ def __init__( # pylint: disable=too-many-locals """ :keyword support_ticket_id: System generated support ticket Id that is unique. :paramtype support_ticket_id: str - :keyword description: Detailed description of the question or issue. Required. + :keyword description: Detailed description of the question or issue. :paramtype description: str :keyword problem_classification_id: Each Azure service has its own set of issue categories, also known as problem classification. This parameter is the unique Id for the type of problem - you are experiencing. Required. + you are experiencing. :paramtype problem_classification_id: str :keyword severity: A value that indicates the urgency of the case, which in turn determines the response time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also known as the 'Emergency - Severe impact' - level in the Azure portal is reserved only for our Premium customers. Required. Known values - are: "minimal", "moderate", "critical", and "highestcriticalimpact". + level in the Azure portal is reserved only for our Premium customers. Known values are: + "minimal", "moderate", "critical", and "highestcriticalimpact". :paramtype severity: str or ~azure.mgmt.support.models.SeverityLevel :keyword enrollment_id: Enrollment Id associated with the support ticket. :paramtype enrollment_id: str :keyword require24_x7_response: Indicates if this requires a 24x7 response from Azure. :paramtype require24_x7_response: bool :keyword advanced_diagnostic_consent: Advanced diagnostic consent to be updated on the support - ticket. Required. Known values are: "Yes" and "No". + ticket. Known values are: "Yes" and "No". :paramtype advanced_diagnostic_consent: str or ~azure.mgmt.support.models.Consent :keyword problem_scoping_questions: Problem scoping questions associated with the support ticket. @@ -1339,19 +1670,19 @@ def __init__( # pylint: disable=too-many-locals :keyword support_plan_id: Support plan id associated with the support ticket. :paramtype support_plan_id: str :keyword contact_details: Contact information of the user requesting to create a support - ticket. Required. + ticket. :paramtype contact_details: ~azure.mgmt.support.models.ContactProfile :keyword service_level_agreement: Service Level Agreement information for this support ticket. :paramtype service_level_agreement: ~azure.mgmt.support.models.ServiceLevelAgreement :keyword support_engineer: Information about the support engineer working on this support ticket. :paramtype support_engineer: ~azure.mgmt.support.models.SupportEngineer - :keyword title: Title of the support ticket. Required. + :keyword title: Title of the support ticket. :paramtype title: str :keyword problem_start_time: Time in UTC (ISO 8601 format) when the problem started. :paramtype problem_start_time: ~datetime.datetime :keyword service_id: This is the resource Id of the Azure service resource associated with the - support ticket. Required. + support ticket. :paramtype service_id: str :keyword file_workspace_name: File workspace name. :paramtype file_workspace_name: str @@ -1616,8 +1947,7 @@ def __init__( class UpdateSupportTicket(_serialization.Model): - """Updates severity, ticket status, contact details, advanced diagnostic consent and secondary - consent in the support ticket. + """Updates severity, ticket status, and contact details in the support ticket. :ivar severity: Severity level. Known values are: "minimal", "moderate", "critical", and "highestcriticalimpact". diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/__init__.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/__init__.py index 7700443bd45e..e6dfd621f375 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/__init__.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/__init__.py @@ -8,6 +8,9 @@ from ._operations import Operations from ._services_operations import ServicesOperations +from ._service_classifications_no_subscription_operations import ServiceClassificationsNoSubscriptionOperations +from ._service_classifications_operations import ServiceClassificationsOperations +from ._problem_classifications_no_subscription_operations import ProblemClassificationsNoSubscriptionOperations from ._problem_classifications_operations import ProblemClassificationsOperations from ._support_tickets_operations import SupportTicketsOperations from ._support_tickets_no_subscription_operations import SupportTicketsNoSubscriptionOperations @@ -19,6 +22,7 @@ from ._file_workspaces_no_subscription_operations import FileWorkspacesNoSubscriptionOperations from ._files_operations import FilesOperations from ._files_no_subscription_operations import FilesNoSubscriptionOperations +from ._look_up_resource_id_operations import LookUpResourceIdOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -27,6 +31,9 @@ __all__ = [ "Operations", "ServicesOperations", + "ServiceClassificationsNoSubscriptionOperations", + "ServiceClassificationsOperations", + "ProblemClassificationsNoSubscriptionOperations", "ProblemClassificationsOperations", "SupportTicketsOperations", "SupportTicketsNoSubscriptionOperations", @@ -38,6 +45,7 @@ "FileWorkspacesNoSubscriptionOperations", "FilesOperations", "FilesNoSubscriptionOperations", + "LookUpResourceIdOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_no_subscription_operations.py index c422366064be..d206f7c5b18e 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_no_subscription_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(support_ticket_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,7 @@ def build_get_request(support_ticket_name: str, chat_transcript_name: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +129,7 @@ def list(self, support_ticket_name: str, **kwargs: Any) -> Iterable["_models.Cha api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChatTranscriptsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -199,7 +204,7 @@ def get(self, support_ticket_name: str, chat_transcript_name: str, **kwargs: Any :rtype: ~azure.mgmt.support.models.ChatTranscriptDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_operations.py index 1f47a12e2ffc..44cb31e9062c 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_chat_transcripts_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(support_ticket_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +136,7 @@ def list(self, support_ticket_name: str, **kwargs: Any) -> Iterable["_models.Cha api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChatTranscriptsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def get(self, support_ticket_name: str, chat_transcript_name: str, **kwargs: Any :rtype: ~azure.mgmt.support.models.ChatTranscriptDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_no_subscription_operations.py index 1b9c73cd0c63..12200cd0c0a2 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_check_name_availability_request(support_ticket_name: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -74,7 +79,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +107,7 @@ def build_get_request(support_ticket_name: str, communication_name: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +135,7 @@ def build_create_request(support_ticket_name: str, communication_name: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -244,7 +249,7 @@ def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ def list( """Lists all communications (attachments not included) for a support ticket. :code:`
`
You can also filter support ticket communications by *CreatedDate* or *CommunicationType* using the $filter parameter. The only type of communication supported today is *Web*. Output will be - a paged result with *nextLink*\ , using which you can retrieve the next set of Communication + a paged result with *nextLink*\\ , using which you can retrieve the next set of Communication results. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -332,7 +337,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CommunicationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +414,7 @@ def get(self, support_ticket_name: str, communication_name: str, **kwargs: Any) :rtype: ~azure.mgmt.support.models.CommunicationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ def _create_initial( create_communication_parameters: Union[_models.CommunicationDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.CommunicationDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_operations.py index f6ddfe767097..5de80cb767dd 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_communications_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_check_name_availability_request(support_ticket_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -81,7 +86,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +120,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -261,7 +266,7 @@ def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +328,7 @@ def list( """Lists all communications (attachments not included) for a support ticket. :code:`
`
You can also filter support ticket communications by *CreatedDate* or *CommunicationType* using the $filter parameter. The only type of communication supported today is *Web*. Output will be - a paged result with *nextLink*\ , using which you can retrieve the next set of Communication + a paged result with *nextLink*\\ , using which you can retrieve the next set of Communication results. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -350,7 +355,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CommunicationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +433,7 @@ def get(self, support_ticket_name: str, communication_name: str, **kwargs: Any) :rtype: ~azure.mgmt.support.models.CommunicationDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +484,7 @@ def _create_initial( create_communication_parameters: Union[_models.CommunicationDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.CommunicationDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_no_subscription_operations.py index 081010141e51..814528495773 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_no_subscription_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +43,7 @@ def build_get_request(file_workspace_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +67,7 @@ def build_create_request(file_workspace_name: str, **kwargs: Any) -> HttpRequest _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +118,7 @@ def get(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWorkspaceD :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def create(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWorkspa :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_operations.py index eb2e8bb39df3..42cd9f955394 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_file_workspaces_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +43,7 @@ def build_get_request(file_workspace_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +70,7 @@ def build_create_request(file_workspace_name: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +124,7 @@ def get(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWorkspaceD :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def create(self, file_workspace_name: str, **kwargs: Any) -> _models.FileWorkspa :rtype: ~azure.mgmt.support.models.FileWorkspaceDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_no_subscription_operations.py index 30f3b465c88e..cc2f97b81f3e 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_list_request(file_workspace_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +70,7 @@ def build_get_request(file_workspace_name: str, file_name: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,7 @@ def build_create_request(file_workspace_name: str, file_name: str, **kwargs: Any _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,7 +129,7 @@ def build_upload_request(file_workspace_name: str, file_name: str, **kwargs: Any _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,7 +190,7 @@ def list(self, file_workspace_name: str, **kwargs: Any) -> Iterable["_models.Fil api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FilesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -260,7 +265,7 @@ def get(self, file_workspace_name: str, file_name: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ def create( :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -500,7 +505,7 @@ def upload( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_operations.py index 491f9497fe59..71dda11472b4 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_files_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +46,7 @@ def build_list_request(file_workspace_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(file_workspace_name: str, file_name: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +103,7 @@ def build_create_request(file_workspace_name: str, file_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +137,7 @@ def build_upload_request(file_workspace_name: str, file_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -195,7 +200,7 @@ def list(self, file_workspace_name: str, **kwargs: Any) -> Iterable["_models.Fil api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FilesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ def get(self, file_workspace_name: str, file_name: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +393,7 @@ def create( :rtype: ~azure.mgmt.support.models.FileDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +518,7 @@ def upload( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_look_up_resource_id_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_look_up_resource_id_operations.py new file mode 100644 index 000000000000..d83d35872c76 --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_look_up_resource_id_operations.py @@ -0,0 +1,191 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_post_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Support/lookUpResourceId") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class LookUpResourceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.MicrosoftSupport`'s + :attr:`look_up_resource_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def post( + self, + look_up_resource_id_request: _models.LookUpResourceIdRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Required. + :type look_up_resource_id_request: ~azure.mgmt.support.models.LookUpResourceIdRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, look_up_resource_id_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Required. + :type look_up_resource_id_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def post( + self, look_up_resource_id_request: Union[_models.LookUpResourceIdRequest, IO[bytes]], **kwargs: Any + ) -> _models.LookUpResourceIdResponse: + """This operation fetches ARM resource id of support resource type. + + This operation fetches ARM resource id of support resource type. + + :param look_up_resource_id_request: Look up resource id request body. Is either a + LookUpResourceIdRequest type or a IO[bytes] type. Required. + :type look_up_resource_id_request: ~azure.mgmt.support.models.LookUpResourceIdRequest or + IO[bytes] + :return: LookUpResourceIdResponse or the result of cls(response) + :rtype: ~azure.mgmt.support.models.LookUpResourceIdResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LookUpResourceIdResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(look_up_resource_id_request, (IOBase, bytes)): + _content = look_up_resource_id_request + else: + _json = self._serialize.body(look_up_resource_id_request, "LookUpResourceIdRequest") + + _request = build_post_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LookUpResourceIdResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_operations.py index 864083b878b6..5e84edd89eb5 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_no_subscription_operations.py new file mode 100644 index 000000000000..b8715d8f5ea8 --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_no_subscription_operations.py @@ -0,0 +1,216 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_classify_problems_request(problem_service_name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") + path_format_arguments = { + "problemServiceName": _SERIALIZER.url( + "problem_service_name", problem_service_name, "str", pattern=r"^[0-9a-zA-Z_\-. ]+$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ProblemClassificationsNoSubscriptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.MicrosoftSupport`'s + :attr:`problem_classifications_no_subscription` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: _models.ProblemClassificationsClassificationInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: Union[ + _models.ProblemClassificationsClassificationInput, IO[bytes] + ], + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Is either a + ProblemClassificationsClassificationInput type or a IO[bytes] type. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput or IO[bytes] + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProblemClassificationsClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(problem_classifications_classification_input, (IOBase, bytes)): + _content = problem_classifications_classification_input + else: + _json = self._serialize.body( + problem_classifications_classification_input, "ProblemClassificationsClassificationInput" + ) + + _request = build_classify_problems_request( + problem_service_name=problem_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ProblemClassificationsClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_operations.py index d161a05a612d..30dcb4857cf9 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_problem_classifications_operations.py @@ -6,7 +6,9 @@ # 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, Callable, Dict, Iterable, Optional, TypeVar +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -29,6 +31,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -36,11 +42,44 @@ _SERIALIZER.client_side_validation = False +def build_classify_problems_request(problem_service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "problemServiceName": _SERIALIZER.url( + "problem_service_name", problem_service_name, "str", pattern=r"^[0-9a-zA-Z_\-. ]+$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_list_request(service_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +103,7 @@ def build_get_request(service_name: str, problem_classification_name: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,6 +146,134 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: _models.ProblemClassificationsClassificationInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Required. + :type problem_classifications_classification_input: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def classify_problems( + self, + problem_service_name: str, + problem_classifications_classification_input: Union[ + _models.ProblemClassificationsClassificationInput, IO[bytes] + ], + **kwargs: Any + ) -> _models.ProblemClassificationsClassificationOutput: + """Classify the right problem classifications (categories) available for a specific Azure service. + + :param problem_service_name: Name of the Azure service for which the problem classifications + need to be retrieved. Required. + :type problem_service_name: str + :param problem_classifications_classification_input: Input to check. Is either a + ProblemClassificationsClassificationInput type or a IO[bytes] type. Required. + :type problem_classifications_classification_input: + ~azure.mgmt.support.models.ProblemClassificationsClassificationInput or IO[bytes] + :return: ProblemClassificationsClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ProblemClassificationsClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProblemClassificationsClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(problem_classifications_classification_input, (IOBase, bytes)): + _content = problem_classifications_classification_input + else: + _json = self._serialize.body( + problem_classifications_classification_input, "ProblemClassificationsClassificationInput" + ) + + _request = build_classify_problems_request( + problem_service_name=problem_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ProblemClassificationsClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace def list(self, service_name: str, **kwargs: Any) -> Iterable["_models.ProblemClassification"]: """Lists all the problem classifications (categories) available for a specific Azure service. @@ -127,7 +294,7 @@ def list(self, service_name: str, **kwargs: Any) -> Iterable["_models.ProblemCla api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProblemClassificationsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +361,8 @@ def get_next(next_link=None): def get(self, service_name: str, problem_classification_name: str, **kwargs: Any) -> _models.ProblemClassification: """Get problem classification details for a specific Azure service. - :param service_name: Name of the Azure service available for support. Required. + :param service_name: Name of the Azure service for which the problem classifications need to be + retrieved. Required. :type service_name: str :param problem_classification_name: Name of problem classification. Required. :type problem_classification_name: str @@ -202,7 +370,7 @@ def get(self, service_name: str, problem_classification_name: str, **kwargs: Any :rtype: ~azure.mgmt.support.models.ProblemClassification :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_no_subscription_operations.py new file mode 100644 index 000000000000..03142b7d0be0 --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_no_subscription_operations.py @@ -0,0 +1,185 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_classify_services_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Support/classifyServices") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ServiceClassificationsNoSubscriptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.MicrosoftSupport`'s + :attr:`service_classifications_no_subscription` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def classify_services( + self, + service_classification_request: _models.ServiceClassificationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def classify_services( + self, service_classification_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def classify_services( + self, service_classification_request: Union[_models.ServiceClassificationRequest, IO[bytes]], **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Is either a ServiceClassificationRequest + type or a IO[bytes] type. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + or IO[bytes] + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_classification_request, (IOBase, bytes)): + _content = service_classification_request + else: + _json = self._serialize.body(service_classification_request, "ServiceClassificationRequest") + + _request = build_classify_services_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_operations.py new file mode 100644 index 000000000000..2f5e8d664e8e --- /dev/null +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_service_classifications_operations.py @@ -0,0 +1,191 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_classify_services_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Support/classifyServices") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ServiceClassificationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.support.MicrosoftSupport`'s + :attr:`service_classifications` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def classify_services( + self, + service_classification_request: _models.ServiceClassificationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def classify_services( + self, service_classification_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Required. + :type service_classification_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def classify_services( + self, service_classification_request: Union[_models.ServiceClassificationRequest, IO[bytes]], **kwargs: Any + ) -> _models.ServiceClassificationOutput: + """Classify the list of right Azure services. + + :param service_classification_request: Input to check. Is either a ServiceClassificationRequest + type or a IO[bytes] type. Required. + :type service_classification_request: ~azure.mgmt.support.models.ServiceClassificationRequest + or IO[bytes] + :return: ServiceClassificationOutput or the result of cls(response) + :rtype: ~azure.mgmt.support.models.ServiceClassificationOutput + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceClassificationOutput] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(service_classification_request, (IOBase, bytes)): + _content = service_classification_request + else: + _json = self._serialize.body(service_classification_request, "ServiceClassificationRequest") + + _request = build_classify_services_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceClassificationOutput", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_services_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_services_operations.py index c1d983161a37..a6a35e45c8b7 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_services_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_services_operations.py @@ -6,7 +6,8 @@ # 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, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +64,7 @@ def build_get_request(service_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +123,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Service"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,13 +189,14 @@ def get_next(next_link=None): def get(self, service_name: str, **kwargs: Any) -> _models.Service: """Gets a specific Azure service for support ticket creation. - :param service_name: Name of the Azure service. Required. + :param service_name: Name of the Azure service for which the problem classifications need to be + retrieved. Required. :type service_name: str :return: Service or the result of cls(response) :rtype: ~azure.mgmt.support.models.Service :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_no_subscription_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_no_subscription_operations.py index f69e8ea51c78..74336975cf97 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_no_subscription_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_no_subscription_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_check_name_availability_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -65,7 +70,7 @@ def build_list_request(*, top: Optional[int] = None, filter: Optional[str] = Non _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_get_request(support_ticket_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +117,7 @@ def build_update_request(support_ticket_name: str, **kwargs: Any) -> HttpRequest _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +144,7 @@ def build_create_request(support_ticket_name: str, **kwargs: Any) -> HttpRequest _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -234,7 +239,7 @@ def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportTicketsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get(self, support_ticket_name: str, **kwargs: Any) -> _models.SupportTicketD :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +520,7 @@ def update( :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def _create_initial( create_support_ticket_parameters: Union[_models.SupportTicketDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.SupportTicketDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_operations.py b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_operations.py index 9a9c95f7a740..9898cc01e05c 100644 --- a/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_operations.py +++ b/sdk/support/azure-mgmt-support/azure/mgmt/support/operations/_support_tickets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -74,7 +79,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +107,7 @@ def build_get_request(support_ticket_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +134,7 @@ def build_update_request(support_ticket_name: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +164,7 @@ def build_create_request(support_ticket_name: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -257,7 +262,7 @@ def check_name_availability( :rtype: ~azure.mgmt.support.models.CheckNameAvailabilityOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,8 +321,8 @@ def list( self, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.SupportTicketDetails"]: """Lists all the support tickets for an Azure subscription. You can also filter the support - tickets by *Status*\ , *CreatedDate*\ , *ServiceId*\ , and *ProblemClassificationId* using the - $filter parameter. Output will be a paged result with *nextLink*\ , using which you can + tickets by *Status*\\ , *CreatedDate*\\ , *ServiceId*\\ , and *ProblemClassificationId* using + the $filter parameter. Output will be a paged result with *nextLink*\\ , using which you can retrieve the next set of support tickets. :code:`
`:code:`
`Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. @@ -326,8 +331,8 @@ def list( Default value is None. :type top: int :param filter: The filter to apply on the operation. We support 'odata v4.0' filter semantics. - `Learn more `_. *Status*\ , - *ServiceId*\ , and *ProblemClassificationId* filters can only be used with Equals ('eq') + `Learn more `_. *Status*\\ , + *ServiceId*\\ , and *ProblemClassificationId* filters can only be used with Equals ('eq') operator. For *CreatedDate* filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine them using the logical 'AND'. Default value is None. @@ -343,7 +348,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportTicketsListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +425,7 @@ def get(self, support_ticket_name: str, **kwargs: Any) -> _models.SupportTicketD :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +544,7 @@ def update( :rtype: ~azure.mgmt.support.models.SupportTicketDetails :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ def _create_initial( create_support_ticket_parameters: Union[_models.SupportTicketDetails, IO[bytes]], **kwargs: Any ) -> Optional[_models.SupportTicketDetails]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -678,8 +683,8 @@ def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the @@ -720,8 +725,8 @@ def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the @@ -760,8 +765,8 @@ def begin_create( new file.:code:`
`:code:`
`Providing consent to share diagnostic information with Azure support is currently not supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if your issue requires gathering diagnostic - information from your Azure resources.:code:`
`:code:`
`\ **Creating a support ticket - for on-behalf-of**\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary + information from your Azure resources.:code:`
`:code:`
`\\ **Creating a support ticket + for on-behalf-of**\\ : Include *x-ms-authorization-auxiliary* header to provide an auxiliary token as per `documentation `_. The primary token will be from the tenant for whom a support ticket is being raised against the diff --git a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability.py b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability.py index f83f10a7b1d8..903dcae3326e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability.py +++ b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_no_subscription_support_ticket_communication.py b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_no_subscription_support_ticket_communication.py index 8a49408f5129..11efa11be966 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_no_subscription_support_ticket_communication.py +++ b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_no_subscription_support_ticket_communication.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_support_ticket_communication.py b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_support_ticket_communication.py index 1432722ef48e..5a97d58aed6e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_support_ticket_communication.py +++ b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_for_support_ticket_communication.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.check_name_availability( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CheckNameAvailabilityForSupportTicketCommunication.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_with_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_with_subscription.py index e4e782b75da0..2e74fd5444af 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_with_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/check_name_availability_with_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.check_name_availability( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityWithSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CheckNameAvailabilityWithSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications.py b/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications.py new file mode 100644 index 000000000000..61b930d1476d --- /dev/null +++ b/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.support import MicrosoftSupport + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-support +# USAGE + python classify_problem_classifications.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftSupport( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.problem_classifications_no_subscription.classify_problems( + problem_service_name="serviceId1", + problem_classifications_classification_input={"issueSummary": "Can not connect to Windows VM"}, + ) + print(response) + + +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyProblemClassifications.json +if __name__ == "__main__": + main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications_for_subscription.py new file mode 100644 index 000000000000..ba0e018a9324 --- /dev/null +++ b/sdk/support/azure-mgmt-support/generated_samples/classify_problem_classifications_for_subscription.py @@ -0,0 +1,47 @@ +# 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, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.support import MicrosoftSupport + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-support +# USAGE + python classify_problem_classifications_for_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftSupport( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.problem_classifications.classify_problems( + problem_service_name="serviceId1", + problem_classifications_classification_input={ + "issueSummary": "Can not connect to Windows VM", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname", + }, + ) + print(response) + + +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyProblemClassificationsForSubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/classify_services.py b/sdk/support/azure-mgmt-support/generated_samples/classify_services.py new file mode 100644 index 000000000000..0a24cdb59360 --- /dev/null +++ b/sdk/support/azure-mgmt-support/generated_samples/classify_services.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.support import MicrosoftSupport + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-support +# USAGE + python classify_services.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftSupport( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.service_classifications_no_subscription.classify_services( + service_classification_request={ + "issueSummary": "Can not connect to Windows VM", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname", + }, + ) + print(response) + + +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyServices.json +if __name__ == "__main__": + main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/classify_services_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/classify_services_for_subscription.py new file mode 100644 index 000000000000..868c20fee582 --- /dev/null +++ b/sdk/support/azure-mgmt-support/generated_samples/classify_services_for_subscription.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.support import MicrosoftSupport + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-support +# USAGE + python classify_services_for_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftSupport( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.service_classifications.classify_services( + service_classification_request={ + "issueSummary": "Can not connect to Windows VM", + "resourceId": "/subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname", + }, + ) + print(response) + + +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyServicesForSubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_active_jobs.py b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_active_jobs.py index 201ec42c20c2..b0e56026201a 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_active_jobs.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_active_jobs.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_dedicated_cores.py b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_dedicated_cores.py index e25dd7ab55d1..b5e25d855a88 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_dedicated_cores.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_dedicated_cores.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_low_priority_cores.py b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_low_priority_cores.py index 1c78299a0f90..d3cb05e1a0e3 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_low_priority_cores.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_low_priority_cores.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_pools.py b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_pools.py index d97968923e63..dd924b43ad5b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_pools.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_specific_batch_account_for_pools.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_subscription.py index 5da11c666290..6d12eae8b136 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_batch_quota_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -63,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBatchQuotaTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket.py index 7facd9c7bb39..7bf0397a4151 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket.py @@ -36,7 +36,6 @@ def main(): support_ticket_name="testticket", create_support_ticket_parameters={ "properties": { - "advancedDiagnosticConsent": "No", "contactDetails": { "country": "usa", "firstName": "abc", @@ -59,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBillingSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket_for_subscription.py index 609ede7789b3..0a2a5b5b954c 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_billing_support_ticket_for_subscription.py @@ -29,14 +29,13 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( support_ticket_name="testticket", create_support_ticket_parameters={ "properties": { - "advancedDiagnosticConsent": "No", "contactDetails": { "country": "usa", "firstName": "abc", @@ -59,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateBillingSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_cores_quota_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_cores_quota_ticket_for_subscription.py index 77b4a9ae699a..5c16eeb84c2a 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_cores_quota_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_cores_quota_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -62,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateCoresQuotaTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_file.py b/sdk/support/azure-mgmt-support/generated_samples/create_file.py index ec7bf878433d..70c2eb72f0f9 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_file.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_file.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFile.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_file_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_file_for_subscription.py index 237aff1173db..99828b27b038 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_file_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_file_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.files.create( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFileForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace.py b/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace.py index 3f8422e93f00..dacb03fb8fa7 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFileWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace_for_subscription.py index 7be82e339382..7359040f6b38 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_file_workspace_for_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.file_workspaces.create( @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspaceForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFileWorkspaceForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_generic_quota_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/create_generic_quota_ticket.py index d314e0c6ae2a..5379d9b5fd13 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_generic_quota_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_generic_quota_ticket.py @@ -29,14 +29,13 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( support_ticket_name="testticket", create_support_ticket_parameters={ "properties": { - "advancedDiagnosticConsent": "Yes", "contactDetails": { "country": "usa", "firstName": "abc", @@ -57,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateGenericQuotaTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_dedicated_cores.py b/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_dedicated_cores.py index f95080a3c51f..03790b237a1d 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_dedicated_cores.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_dedicated_cores.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_low_priority_cores.py b/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_low_priority_cores.py index 44ff700028a5..89d84b879739 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_low_priority_cores.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_machine_learning_quota_ticket_for_low_priority_cores.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -63,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_no_subscription_support_ticket_communication.py b/sdk/support/azure-mgmt-support/generated_samples/create_no_subscription_support_ticket_communication.py index eef2a18f6d3c..4e90281e38e1 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_no_subscription_support_ticket_communication.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_no_subscription_support_ticket_communication.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateNoSubscriptionSupportTicketCommunication.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateNoSubscriptionSupportTicketCommunication.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_dtus.py b/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_dtus.py index 32099f323ad9..cc79e903da84 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_dtus.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_dtus.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSqlDatabaseQuotaTicketForDTUs.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_servers.py b/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_servers.py index cca555c98d93..204949ce54d7 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_servers.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sql_database_quota_ticket_for_servers.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -63,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSqlDatabaseQuotaTicketForServers.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_dtus.py b/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_dtus.py index 1fc44e2e28f9..a10f864dea0f 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_dtus.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_dtus.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_servers.py b/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_servers.py index 9c2f40077aef..6e5b01af4ab5 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_servers.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sql_datawarehouse_quota_ticket_for_servers.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -63,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSqlDatawarehouseQuotaTicketForServers.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sql_managed_instance_quota_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/create_sql_managed_instance_quota_ticket.py index e1ac8f328ab2..153cb86b3aa2 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sql_managed_instance_quota_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sql_managed_instance_quota_ticket.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSqlManagedInstanceQuotaTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket.py index 1bbad7128cd0..218e39c8da5b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket.py @@ -36,7 +36,6 @@ def main(): support_ticket_name="testticket", create_support_ticket_parameters={ "properties": { - "advancedDiagnosticConsent": "Yes", "contactDetails": { "country": "usa", "firstName": "abc", @@ -59,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSubMgmtSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket_for_subscription.py index 25cd5acf9a91..1c852bb4aeb4 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_sub_mgmt_support_ticket_for_subscription.py @@ -29,14 +29,13 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( support_ticket_name="testticket", create_support_ticket_parameters={ "properties": { - "advancedDiagnosticConsent": "No", "contactDetails": { "country": "usa", "firstName": "abc", @@ -59,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSubMgmtSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_support_ticket_communication.py b/sdk/support/azure-mgmt-support/generated_samples/create_support_ticket_communication.py index 11e6b079c8b5..99463a5748e3 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_support_ticket_communication.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_support_ticket_communication.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.begin_create( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSupportTicketCommunication.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateSupportTicketCommunication.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket.py index 70d7f416840b..f92509ada07c 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket.py @@ -61,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateTechnicalSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket_for_subscription.py index 0b292dbf0f94..f4f2fb9a927b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/create_technical_support_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.begin_create( @@ -55,7 +55,7 @@ def main(): "severity": "moderate", "supportPlanId": "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=", "technicalTicketDetails": { - "resourceId": "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver" + "resourceId": "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver" }, "title": "my title", } @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateTechnicalSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_subscription_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_subscription_support_ticket.py index e1bcfbb4d638..1f72d273b314 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_subscription_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_subscription_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_support_ticket.py index e2ff54027f82..9dfa2b479f6c 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_communication_details_for_support_ticket.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetCommunicationDetailsForSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_file_details.py b/sdk/support/azure-mgmt-support/generated_samples/get_file_details.py index 155d96f6d149..52fd0a0752e7 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_file_details.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_file_details.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileDetails.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_file_details_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/get_file_details_for_subscription.py index b5f74a3a28d0..acbcc4dba36e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_file_details_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_file_details_for_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.files.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileDetailsForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details.py b/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details.py index 9c9880bea433..ac94e886476b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileWorkspaceDetails.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details_for_subscription.py index 7254994d8c16..cb91d134da4a 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_file_workspace_details_for_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.file_workspaces.get( @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetailsForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileWorkspaceDetailsForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_problem_classification.py b/sdk/support/azure-mgmt-support/generated_samples/get_problem_classification.py index d985362e96b8..39f55930f5ad 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_problem_classification.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_problem_classification.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetProblemClassification.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_service.py b/sdk/support/azure-mgmt-support/generated_samples/get_service.py index 6afa7e4fe239..c7cebf085d95 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_service.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_service.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetService.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_subscription_support_ticket_details.py b/sdk/support/azure-mgmt-support/generated_samples/get_subscription_support_ticket_details.py index 75629c95895d..c82bbaa42b01 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_subscription_support_ticket_details.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_subscription_support_ticket_details.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.get( @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSubscriptionSupportTicketDetails.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetSubscriptionSupportTicketDetails.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/get_support_ticket_details.py b/sdk/support/azure-mgmt-support/generated_samples/get_support_ticket_details.py index 2a25fee7c9e2..abde23002e4e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/get_support_ticket_details.py +++ b/sdk/support/azure-mgmt-support/generated_samples/get_support_ticket_details.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetSupportTicketDetails.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_subscription_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_subscription_support_ticket.py index f82f6f92bcaa..f5c7c88e618e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_subscription_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_subscription_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.chat_transcripts.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSubscriptionSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetchatTranscriptDetailsForSubscriptionSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_support_ticket.py index 8f6a6f4a9595..1be4409a0f53 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/getchat_transcript_details_for_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", + subscription_id="subid", ) response = client.chat_transcripts_no_subscription.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetchatTranscriptDetailsForSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_subscription_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_subscription_support_ticket.py index 845f4567160e..a91fc1fdcd7f 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_subscription_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_subscription_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.chat_transcripts.list( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSubscriptionSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListChatTranscriptsForSubscriptionSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_support_ticket.py index 984b21292d76..76f73e9757c5 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_chat_transcripts_for_support_ticket.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListChatTranscriptsForSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_subscription_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_subscription_support_ticket.py index b8fda155d9d3..87bbaabba1bf 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_subscription_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_subscription_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.list( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListCommunicationsForSubscriptionSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_support_ticket.py index d60c87b5b8b0..fc495e5a171b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_communications_for_support_ticket.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListCommunicationsForSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_files_for_subscription_under_file_workspace.py b/sdk/support/azure-mgmt-support/generated_samples/list_files_for_subscription_under_file_workspace.py index 99638db9ea9a..a871fa85c550 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_files_for_subscription_under_file_workspace.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_files_for_subscription_under_file_workspace.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.files.list( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesForSubscriptionUnderFileWorkspace.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListFilesForSubscriptionUnderFileWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_files_under_file_workspace.py b/sdk/support/azure-mgmt-support/generated_samples/list_files_under_file_workspace.py index afe2c8209c09..cecd2e14e0c4 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_files_under_file_workspace.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_files_under_file_workspace.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListFilesUnderFileWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_operations.py b/sdk/support/azure-mgmt-support/generated_samples/list_operations.py index 8a26c2b5b440..4218b7ed1d07 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_operations.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListOperations.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_problem_classifications.py b/sdk/support/azure-mgmt-support/generated_samples/list_problem_classifications.py index fe8104b96f53..3bbcea826b82 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_problem_classifications.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_problem_classifications.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListProblemClassifications.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_services.py b/sdk/support/azure-mgmt-support/generated_samples/list_services.py index 5c29dc1036a5..1edc17c8c62d 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_services.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_services.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListServices.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets.py index 5402342c9711..6def4bac88e7 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTickets.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_by_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_by_subscription.py index 50caa59cf10a..4e88bb96f616 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_by_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_by_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsBySubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state.py index 8f5eac42a009..13b8ea5036af 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state_by_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state_by_subscription.py index 37be084c986e..72aba7d0ca1f 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state_by_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_open_state_by_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state.py index a87c84812596..c31ab5dc112d 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state_by_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state_by_subscription.py index 806c49721ef1..aab0395c5367 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state_by_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_created_on_or_after_and_in_updating_state_by_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state.py index bd2e98cfcd66..cb18f361e92b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsInOpenState.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state_by_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state_by_subscription.py index b3207763d547..058fd2e63b09 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state_by_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_open_state_by_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsInOpenStateBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state.py index e603fe049a8b..5b96af13f503 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingState.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsInUpdatingState.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state_by_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state_by_subscription.py index c6d5a5748964..03ecd190637e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state_by_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_in_updating_state_by_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingStateBySubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsInUpdatingStateBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals.py index 58e993d343cc..3a9ad5c19e13 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEquals.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsProblemClassificationIdEquals.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals_for_subscription.py index d78bf90a4b28..c0b4d090170b 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_problem_classification_id_equals_for_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals.py index e76f01a79290..1735fefabe31 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEquals.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsServiceIdEquals.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals_for_subscription.py index d724f34b0873..2e69f159baaf 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_support_tickets_service_id_equals_for_subscription.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTicketsServiceIdEqualsForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket.py index 2d5d9bfe6584..ad559fdbd2b3 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.list( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListWebCommunicationsForSubscriptionSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket_created_on_or_after.py b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket_created_on_or_after.py index a2401aecb337..ad83bd6bf1d8 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket_created_on_or_after.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_subscription_support_ticket_created_on_or_after.py @@ -27,7 +27,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.communications.list( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket.py index 4f292da979d3..1ff1de42efd5 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListWebCommunicationsForSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket_created_on_or_after.py b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket_created_on_or_after.py index 4f8f563d813f..b5684a0a9a8a 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket_created_on_or_after.py +++ b/sdk/support/azure-mgmt-support/generated_samples/list_web_communications_for_support_ticket_created_on_or_after.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/look_up_resource_id.py b/sdk/support/azure-mgmt-support/generated_samples/look_up_resource_id.py new file mode 100644 index 000000000000..f80a4339669d --- /dev/null +++ b/sdk/support/azure-mgmt-support/generated_samples/look_up_resource_id.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.support import MicrosoftSupport + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-support +# USAGE + python look_up_resource_id.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftSupport( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.look_up_resource_id.post( + look_up_resource_id_request={"identifier": "1234668596", "type": "Microsoft.Support/supportTickets"}, + ) + print(response) + + +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/LookUpResourceId.json +if __name__ == "__main__": + main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket.py index fe4b106632a4..f9414e3dd26a 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateAdvancedDiagnosticConsentOfSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket_for_subscription.py index e84af5fcb6cb..6c13c697117c 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_advanced_diagnostic_consent_of_support_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.update( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket.py index 90508f2e6a43..0243e6c6af16 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateContactDetailsOfSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket_for_subscription.py index 21c6ddc77e3b..24e09578758f 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_contact_details_of_support_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.update( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateContactDetailsOfSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket.py index 8108586a8a95..d8c997029f33 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateSeverityOfSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket_for_subscription.py index 1afd4d1cc000..27356da87a16 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_severity_of_support_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.update( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateSeverityOfSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket.py b/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket.py index 211d1650c782..e32caf225b1e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateStatusOfSupportTicket.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket_for_subscription.py index d5d5b8b28307..fc1adfbcaa0e 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/update_status_of_support_ticket_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) response = client.support_tickets.update( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UpdateStatusOfSupportTicketForSubscription.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/upload_file.py b/sdk/support/azure-mgmt-support/generated_samples/upload_file.py index d5feaadbf452..0ad2b26e2e62 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/upload_file.py +++ b/sdk/support/azure-mgmt-support/generated_samples/upload_file.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) client.files_no_subscription.upload( @@ -42,6 +42,6 @@ def main(): ) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UploadFile.json if __name__ == "__main__": main() diff --git a/sdk/support/azure-mgmt-support/generated_samples/upload_file_for_subscription.py b/sdk/support/azure-mgmt-support/generated_samples/upload_file_for_subscription.py index b01005c228b6..98e1b0af9bba 100644 --- a/sdk/support/azure-mgmt-support/generated_samples/upload_file_for_subscription.py +++ b/sdk/support/azure-mgmt-support/generated_samples/upload_file_for_subscription.py @@ -29,7 +29,7 @@ def main(): client = MicrosoftSupport( credential=DefaultAzureCredential(), - subscription_id="132d901f-189d-4381-9214-fe68e27e05a1", + subscription_id="subid", ) client.files.upload( @@ -42,6 +42,6 @@ def main(): ) -# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription.json +# x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UploadFileForSubscription.json if __name__ == "__main__": main()