From 6dfe9a7bf5872d908d45a630284d8189a709f887 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 29 Aug 2023 21:57:46 +0000 Subject: [PATCH] CodeGen from PR 25583 in Azure/azure-rest-api-specs Merge c3d50e902abe789604a79cd5fd38c058c62b086e into 766e0f90f4ac7ec129daef80afccea87ca55aac1 --- .../azure-mgmt-healthcareapis/_meta.json | 10 +- .../mgmt/healthcareapis/_configuration.py | 12 +- .../_healthcare_apis_management_client.py | 8 +- .../mgmt/healthcareapis/_serialization.py | 119 ++++-- .../azure/mgmt/healthcareapis/_vendor.py | 11 - .../azure/mgmt/healthcareapis/_version.py | 2 +- .../mgmt/healthcareapis/aio/_configuration.py | 12 +- .../aio/_healthcare_apis_management_client.py | 8 +- .../operations/_dicom_services_operations.py | 61 ++- .../_fhir_destinations_operations.py | 12 +- .../operations/_fhir_services_operations.py | 61 ++- ...t_connector_fhir_destination_operations.py | 39 +- .../operations/_iot_connectors_operations.py | 61 ++- .../_operation_results_operations.py | 12 +- .../aio/operations/_operations.py | 12 +- ...private_endpoint_connections_operations.py | 48 +-- .../_private_link_resources_operations.py | 19 +- .../aio/operations/_services_operations.py | 81 ++-- ...private_endpoint_connections_operations.py | 48 +-- ...space_private_link_resources_operations.py | 19 +- .../aio/operations/_workspaces_operations.py | 68 ++-- .../mgmt/healthcareapis/models/__init__.py | 4 +- .../mgmt/healthcareapis/models/_models_py3.py | 349 ++++++++++-------- .../operations/_dicom_services_operations.py | 93 ++--- .../_fhir_destinations_operations.py | 20 +- .../operations/_fhir_services_operations.py | 93 ++--- ...t_connector_fhir_destination_operations.py | 59 ++- .../operations/_iot_connectors_operations.py | 93 ++--- .../_operation_results_operations.py | 20 +- .../healthcareapis/operations/_operations.py | 14 +- ...private_endpoint_connections_operations.py | 74 ++-- .../_private_link_resources_operations.py | 33 +- .../operations/_services_operations.py | 125 +++---- ...private_endpoint_connections_operations.py | 74 ++-- ...space_private_link_resources_operations.py | 33 +- .../operations/_workspaces_operations.py | 106 +++--- .../check_name_availability_post.py | 2 +- .../dicom_services_create.py | 2 +- .../dicom_services_delete.py | 5 +- .../{ => dicomservices}/dicom_services_get.py | 2 +- .../dicom_services_list.py | 2 +- .../dicom_services_patch.py | 2 +- .../fhir_services_create.py | 7 +- .../fhir_services_delete.py | 5 +- .../{ => fhirservices}/fhir_services_get.py | 2 +- .../{ => fhirservices}/fhir_services_list.py | 2 +- .../{ => fhirservices}/fhir_services_patch.py | 2 +- .../iotconnector_create.py | 2 +- .../iotconnector_delete.py | 5 +- .../iotconnector_fhirdestination_create.py | 2 +- .../iotconnector_fhirdestination_delete.py | 5 +- .../iotconnector_fhirdestination_get.py | 2 +- .../iotconnector_fhirdestination_list.py | 2 +- .../{ => iotconnectors}/iotconnector_get.py | 2 +- .../{ => iotconnectors}/iotconnector_list.py | 2 +- .../{ => iotconnectors}/iotconnector_patch.py | 2 +- .../{ => legacy}/private_link_resource_get.py | 2 +- .../private_link_resources_list_by_service.py | 2 +- .../{ => legacy}/service_create.py | 2 +- ..._data_sovereign_region_with_cmk_enabled.py | 73 ++++ .../{ => legacy}/service_create_minimum.py | 2 +- ...vice_create_private_endpoint_connection.py | 2 +- .../{ => legacy}/service_delete.py | 5 +- ...vice_delete_private_endpoint_connection.py | 5 +- .../{ => legacy}/service_get.py | 2 +- ..._data_sovereign_region_with_cmk_enabled.py | 41 ++ ...service_get_private_endpoint_connection.py | 2 +- .../{ => legacy}/service_list.py | 2 +- .../service_list_by_resource_group.py | 2 +- ...rvice_list_private_endpoint_connections.py | 2 +- .../{ => legacy}/service_patch.py | 2 +- .../operation_results_get.py | 2 +- .../generated_samples/operations_list.py | 2 +- ...rivate_link_resources_list_by_workspace.py | 2 +- ...pace_create_private_endpoint_connection.py | 2 +- ...pace_delete_private_endpoint_connection.py | 5 +- ...rkspace_get_private_endpoint_connection.py | 2 +- ...space_list_private_endpoint_connections.py | 2 +- .../workspace_private_link_resource_get.py | 2 +- .../{ => workspaces}/workspaces_create.py | 2 +- .../{ => workspaces}/workspaces_delete.py | 5 +- .../{ => workspaces}/workspaces_get.py | 2 +- .../workspaces_list_by_resource_group.py | 2 +- .../workspaces_list_by_subscription.py | 2 +- .../{ => workspaces}/workspaces_patch.py | 2 +- 85 files changed, 1009 insertions(+), 1141 deletions(-) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => dicomservices}/dicom_services_create.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => dicomservices}/dicom_services_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => dicomservices}/dicom_services_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => dicomservices}/dicom_services_list.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => dicomservices}/dicom_services_patch.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => fhirservices}/fhir_services_create.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => fhirservices}/fhir_services_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => fhirservices}/fhir_services_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => fhirservices}/fhir_services_list.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => fhirservices}/fhir_services_patch.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_create.py (97%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_fhirdestination_create.py (98%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_fhirdestination_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_fhirdestination_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_fhirdestination_list.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_list.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => iotconnectors}/iotconnector_patch.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/private_link_resource_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/private_link_resources_list_by_service.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_create.py (97%) create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_in_data_sovereign_region_with_cmk_enabled.py rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_create_minimum.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_create_private_endpoint_connection.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_delete_private_endpoint_connection.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_get.py (95%) create mode 100644 sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_in_data_sovereign_region_with_cmk_enabled.py rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_get_private_endpoint_connection.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_list.py (95%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_list_by_resource_group.py (95%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_list_private_endpoint_connections.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => legacy}/service_patch.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/private_link_resources_list_by_workspace.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/workspace_create_private_endpoint_connection.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/workspace_delete_private_endpoint_connection.py (90%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/workspace_get_private_endpoint_connection.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/workspace_list_private_endpoint_connections.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => privatelink}/workspace_private_link_resource_get.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_create.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_delete.py (91%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_get.py (95%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_list_by_resource_group.py (96%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_list_by_subscription.py (95%) rename sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/{ => workspaces}/workspaces_patch.py (96%) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/_meta.json b/sdk/healthcareapis/azure-mgmt-healthcareapis/_meta.json index 1d0b0250a4f1..5e7ee2b8c276 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/_meta.json +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/_meta.json @@ -1,11 +1,11 @@ { - "commit": "fc0c0316bf5187af413a256c484c1e2a259e18b8", + "commit": "c05f9049d11649d9c1fbdde9fbdbca74774c59e2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.2.7", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/healthcareapis/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/healthcareapis/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/healthcareapis/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py index b9f63084dad1..c1d0875c70a4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -33,16 +27,16 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription identifier. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-06". 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: super(HealthcareApisManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", "2022-06-01") + api_version: str = kwargs.pop("api_version", "2023-09-06") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py index af4390e566fd..2d5b8f166451 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py @@ -73,11 +73,11 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers :vartype operation_results: azure.mgmt.healthcareapis.operations.OperationResultsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription identifier. Required. + :param subscription_id: The ID of the target subscription. 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 "2022-06-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-06". 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 @@ -94,7 +94,7 @@ def __init__( self._config = HealthcareApisManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -157,5 +157,5 @@ def __enter__(self) -> "HealthcareApisManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_serialization.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_serialization.py index 2c170e28dbca..4bae2292227b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_serialization.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -602,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -636,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -656,8 +683,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -715,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -723,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -777,6 +804,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -863,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -875,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -922,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -1161,7 +1199,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1242,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1266,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1332,7 +1371,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1391,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1471,7 +1510,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1525,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1535,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_vendor.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_vendor.py index 9aad73fc743e..0dafe0e287ff 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_vendor.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_vendor.py @@ -14,14 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_version.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_version.py index 58920e6942de..e5754a47ce68 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_version.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_configuration.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_configuration.py index eee479c80eb0..34e92b9727a4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_configuration.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -33,16 +27,16 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription identifier. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-06". 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: super(HealthcareApisManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", "2022-06-01") + api_version: str = kwargs.pop("api_version", "2023-09-06") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_healthcare_apis_management_client.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_healthcare_apis_management_client.py index 135fe502784a..1d32bf29c19b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_healthcare_apis_management_client.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/_healthcare_apis_management_client.py @@ -73,11 +73,11 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers :vartype operation_results: azure.mgmt.healthcareapis.aio.operations.OperationResultsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription identifier. Required. + :param subscription_id: The ID of the target subscription. 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 "2022-06-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2023-09-06". 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 @@ -94,7 +94,7 @@ def __init__( self._config = HealthcareApisManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -157,5 +157,5 @@ async def __aenter__(self) -> "HealthcareApisManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_dicom_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_dicom_services_operations.py index f410a67d75f3..f1d3dd6fb89b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_dicom_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_dicom_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DicomServiceCollection] = kwargs.pop("cls", None) error_map = { @@ -141,8 +135,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,9 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DicomService] = kwargs.pop("cls", None) request = build_get_request( @@ -206,8 +199,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -247,16 +241,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dicomservice, (IO, bytes)): + if isinstance(dicomservice, (IOBase, bytes)): _content = dicomservice else: _json = self._serialize.body(dicomservice, "DicomService") @@ -277,8 +269,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,7 +398,7 @@ async def begin_create_or_update( :param dicom_service_name: The name of DICOM Service resource. Required. :type dicom_service_name: str :param dicomservice: The parameters for creating or updating a Dicom Service resource. Is - either a model type or a IO type. Required. + either a DicomService type or a IO type. Required. :type dicomservice: ~azure.mgmt.healthcareapis.models.DicomService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -426,9 +419,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -493,16 +484,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dicomservice_patch_resource, (IO, bytes)): + if isinstance(dicomservice_patch_resource, (IOBase, bytes)): _content = dicomservice_patch_resource else: _json = self._serialize.body(dicomservice_patch_resource, "DicomServicePatchResource") @@ -523,8 +512,9 @@ async def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -646,7 +636,7 @@ async def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param dicomservice_patch_resource: The parameters for updating a Dicom Service. Is either a - model type or a IO type. Required. + DicomServicePatchResource type or a IO type. Required. :type dicomservice_patch_resource: ~azure.mgmt.healthcareapis.models.DicomServicePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -668,9 +658,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -730,9 +718,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -748,8 +734,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -794,9 +781,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_destinations_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_destinations_operations.py index 34790b8bb37a..7b5a3fe12532 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_destinations_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_destinations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._fhir_destinations_operations import build_list_by_iot_connector_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,9 +74,7 @@ def list_by_iot_connector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotFhirDestinationCollection] = kwargs.pop("cls", None) error_map = { @@ -136,8 +129,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_services_operations.py index 7f4496f229e8..25104df87610 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_fhir_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FhirServiceCollection] = kwargs.pop("cls", None) error_map = { @@ -141,8 +135,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,9 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FhirService] = kwargs.pop("cls", None) request = build_get_request( @@ -206,8 +199,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -247,16 +241,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(fhirservice, (IO, bytes)): + if isinstance(fhirservice, (IOBase, bytes)): _content = fhirservice else: _json = self._serialize.body(fhirservice, "FhirService") @@ -277,8 +269,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -403,7 +396,7 @@ async def begin_create_or_update( :param fhir_service_name: The name of FHIR Service resource. Required. :type fhir_service_name: str :param fhirservice: The parameters for creating or updating a Fhir Service resource. Is either - a model type or a IO type. Required. + a FhirService type or a IO type. Required. :type fhirservice: ~azure.mgmt.healthcareapis.models.FhirService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -424,9 +417,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -491,16 +482,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(fhirservice_patch_resource, (IO, bytes)): + if isinstance(fhirservice_patch_resource, (IOBase, bytes)): _content = fhirservice_patch_resource else: _json = self._serialize.body(fhirservice_patch_resource, "FhirServicePatchResource") @@ -521,8 +510,9 @@ async def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -644,7 +634,7 @@ async def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param fhirservice_patch_resource: The parameters for updating a Fhir Service. Is either a - model type or a IO type. Required. + FhirServicePatchResource type or a IO type. Required. :type fhirservice_patch_resource: ~azure.mgmt.healthcareapis.models.FhirServicePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -666,9 +656,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -728,9 +716,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -746,8 +732,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -792,9 +779,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connector_fhir_destination_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connector_fhir_destination_operations.py index f070bd6b438a..f743432d25a0 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connector_fhir_destination_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connector_fhir_destination_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,10 +34,6 @@ build_get_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,9 +93,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotFhirDestination] = kwargs.pop("cls", None) request = build_get_request( @@ -116,8 +110,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -158,16 +153,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotFhirDestination] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_fhir_destination, (IO, bytes)): + if isinstance(iot_fhir_destination, (IOBase, bytes)): _content = iot_fhir_destination else: _json = self._serialize.body(iot_fhir_destination, "IotFhirDestination") @@ -189,8 +182,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,7 +322,7 @@ async def begin_create_or_update( :param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required. :type fhir_destination_name: str :param iot_fhir_destination: The parameters for creating or updating an IoT Connector FHIR - destination resource. Is either a model type or a IO type. Required. + destination resource. Is either a IotFhirDestination type or a IO type. Required. :type iot_fhir_destination: ~azure.mgmt.healthcareapis.models.IotFhirDestination or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -350,9 +344,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotFhirDestination] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -418,9 +410,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -437,8 +427,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -490,9 +481,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connectors_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connectors_operations.py index cd351ee0cc81..baeb5d33b761 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connectors_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_iot_connectors_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotConnectorCollection] = kwargs.pop("cls", None) error_map = { @@ -141,8 +135,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,9 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotConnector] = kwargs.pop("cls", None) request = build_get_request( @@ -206,8 +199,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -247,16 +241,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_connector, (IO, bytes)): + if isinstance(iot_connector, (IOBase, bytes)): _content = iot_connector else: _json = self._serialize.body(iot_connector, "IotConnector") @@ -277,8 +269,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,7 +398,7 @@ async def begin_create_or_update( :param iot_connector_name: The name of IoT Connector resource. Required. :type iot_connector_name: str :param iot_connector: The parameters for creating or updating an IoT Connectors resource. Is - either a model type or a IO type. Required. + either a IotConnector type or a IO type. Required. :type iot_connector: ~azure.mgmt.healthcareapis.models.IotConnector or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -426,9 +419,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -493,16 +484,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_connector_patch_resource, (IO, bytes)): + if isinstance(iot_connector_patch_resource, (IOBase, bytes)): _content = iot_connector_patch_resource else: _json = self._serialize.body(iot_connector_patch_resource, "IotConnectorPatchResource") @@ -523,8 +512,9 @@ async def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -646,7 +636,7 @@ async def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param iot_connector_patch_resource: The parameters for updating an IoT Connector. Is either a - model type or a IO type. Required. + IotConnectorPatchResource type or a IO type. Required. :type iot_connector_patch_resource: ~azure.mgmt.healthcareapis.models.IotConnectorPatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -668,9 +658,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -730,9 +718,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -748,8 +734,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -794,9 +781,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operation_results_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operation_results_operations.py index 37eaff5a8e49..8a8dda5a000a 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operation_results_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operation_results_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._operation_results_operations import build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,9 +76,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationResultsDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -98,8 +91,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operations.py index a842984c7fdc..45d30c1b881f 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,9 +65,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListOperations] = kwargs.pop("cls", None) error_map = { @@ -123,8 +116,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_endpoint_connections_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_endpoint_connections_operations.py index 94978990b89d..7162c6f86d24 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_by_service_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list_by_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -142,8 +136,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -190,9 +185,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -208,8 +201,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -249,16 +243,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "PrivateEndpointConnection") @@ -279,8 +271,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -402,8 +395,8 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Is either a model type or a IO - type. Required. + :param properties: The private endpoint connection properties. Is either a + PrivateEndpointConnection type or a IO type. Required. :type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -425,9 +418,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -487,9 +478,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -505,8 +494,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -552,9 +542,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_link_resources_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_link_resources_operations.py index 4a079f86ce8f..4a76d1dd9e2e 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_link_resources_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_get_request, build_list_by_service_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +77,7 @@ async def list_by_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResultDescription] = kwargs.pop("cls", None) request = build_list_by_service_request( @@ -99,8 +92,9 @@ async def list_by_service( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -150,9 +144,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -168,8 +160,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_services_operations.py index e8d9e29012ce..989333e8bf55 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,10 +41,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,9 +89,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -110,8 +104,9 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -150,16 +145,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(service_description, (IO, bytes)): + if isinstance(service_description, (IOBase, bytes)): _content = service_description else: _json = self._serialize.body(service_description, "ServicesDescription") @@ -179,8 +172,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -294,8 +288,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the service instance. Required. :type resource_name: str - :param service_description: The service instance metadata. Is either a model type or a IO type. - Required. + :param service_description: The service instance metadata. Is either a ServicesDescription type + or a IO type. Required. :type service_description: ~azure.mgmt.healthcareapis.models.ServicesDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -317,9 +311,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -382,16 +374,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(service_patch_description, (IO, bytes)): + if isinstance(service_patch_description, (IOBase, bytes)): _content = service_patch_description else: _json = self._serialize.body(service_patch_description, "ServicesPatchDescription") @@ -411,8 +401,9 @@ async def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -525,7 +516,7 @@ async def begin_update( :param resource_name: The name of the service instance. Required. :type resource_name: str :param service_patch_description: The service instance metadata and security metadata. Is - either a model type or a IO type. Required. + either a ServicesPatchDescription type or a IO type. Required. :type service_patch_description: ~azure.mgmt.healthcareapis.models.ServicesPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -548,9 +539,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -609,9 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -626,8 +613,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,9 +656,7 @@ async def begin_delete(self, resource_group_name: str, resource_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -723,9 +709,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ServicesDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -777,8 +761,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,9 +796,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -866,8 +849,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -935,7 +919,7 @@ async def check_name_availability( :param check_name_availability_inputs: Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. Is - either a model type or a IO type. Required. + either a CheckNameAvailabilityParameters type or a IO type. Required. :type check_name_availability_inputs: ~azure.mgmt.healthcareapis.models.CheckNameAvailabilityParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -957,16 +941,14 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesNameAvailabilityInfo] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_inputs, (IO, bytes)): + if isinstance(check_name_availability_inputs, (IOBase, bytes)): _content = check_name_availability_inputs else: _json = self._serialize.body(check_name_availability_inputs, "CheckNameAvailabilityParameters") @@ -984,8 +966,9 @@ async def check_name_availability( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_endpoint_connections_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_endpoint_connections_operations.py index 46455200d1a1..1f08430bdb0b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_endpoint_connections_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +38,6 @@ build_list_by_workspace_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -142,8 +136,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -190,9 +185,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -208,8 +201,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -249,16 +243,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "PrivateEndpointConnectionDescription") @@ -279,8 +271,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -402,8 +395,8 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Is either a model type or a IO - type. Required. + :param properties: The private endpoint connection properties. Is either a + PrivateEndpointConnectionDescription type or a IO type. Required. :type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -425,9 +418,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -487,9 +478,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -505,8 +494,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -552,9 +542,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_link_resources_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_link_resources_operations.py index 51bd17a2f92f..f348d94d269e 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_link_resources_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspace_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -34,10 +33,6 @@ build_list_by_workspace_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +77,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -138,8 +131,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -185,9 +179,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -203,8 +195,9 @@ async def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspaces_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspaces_operations.py index 0c7206cd7165..397c8fc57465 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspaces_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/aio/operations/_workspaces_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +40,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,9 +75,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Workspac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None) error_map = { @@ -133,8 +127,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -166,9 +161,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None) error_map = { @@ -221,8 +214,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,9 +258,7 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) request = build_get_request( @@ -281,8 +273,9 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -317,16 +310,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workspace, (IO, bytes)): + if isinstance(workspace, (IOBase, bytes)): _content = workspace else: _json = self._serialize.body(workspace, "Workspace") @@ -346,8 +337,9 @@ async def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -459,7 +451,7 @@ async def begin_create_or_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param workspace: The parameters for creating or updating a healthcare workspace. Is either a - model type or a IO type. Required. + Workspace type or a IO type. Required. :type workspace: ~azure.mgmt.healthcareapis.models.Workspace or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -480,9 +472,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -545,16 +535,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workspace_patch_resource, (IO, bytes)): + if isinstance(workspace_patch_resource, (IOBase, bytes)): _content = workspace_patch_resource else: _json = self._serialize.body(workspace_patch_resource, "WorkspacePatchResource") @@ -574,8 +562,9 @@ async def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -688,7 +677,7 @@ async def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param workspace_patch_resource: The parameters for updating a specified workspace. Is either a - model type or a IO type. Required. + WorkspacePatchResource type or a IO type. Required. :type workspace_patch_resource: ~azure.mgmt.healthcareapis.models.WorkspacePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -709,9 +698,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -770,9 +757,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -787,8 +772,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -829,9 +815,7 @@ async def begin_delete(self, resource_group_name: str, workspace_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py index fbafcaf319fd..fadddb4e2d26 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/__init__.py @@ -16,7 +16,6 @@ from ._models_py3 import ErrorDetails from ._models_py3 import ErrorDetailsInternal from ._models_py3 import FhirService -from ._models_py3 import FhirServiceAccessPolicyEntry from ._models_py3 import FhirServiceAcrConfiguration from ._models_py3 import FhirServiceAuthenticationConfiguration from ._models_py3 import FhirServiceCollection @@ -24,6 +23,7 @@ from ._models_py3 import FhirServiceExportConfiguration from ._models_py3 import FhirServiceImportConfiguration from ._models_py3 import FhirServicePatchResource +from ._models_py3 import ImplementationGuidesConfiguration from ._models_py3 import IotConnector from ._models_py3 import IotConnectorCollection from ._models_py3 import IotConnectorPatchResource @@ -111,7 +111,6 @@ "ErrorDetails", "ErrorDetailsInternal", "FhirService", - "FhirServiceAccessPolicyEntry", "FhirServiceAcrConfiguration", "FhirServiceAuthenticationConfiguration", "FhirServiceCollection", @@ -119,6 +118,7 @@ "FhirServiceExportConfiguration", "FhirServiceImportConfiguration", "FhirServicePatchResource", + "ImplementationGuidesConfiguration", "IotConnector", "IotConnectorCollection", "IotConnectorPatchResource", diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py index 7629235debfb..408e3b03895e 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/models/_models_py3.py @@ -45,7 +45,7 @@ class CheckNameAvailabilityParameters(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: str, type: str, **kwargs): + def __init__(self, *, name: str, type: str, **kwargs: Any) -> None: """ :keyword name: The name of the service instance to check. Required. :paramtype name: str @@ -92,8 +92,8 @@ def __init__( methods: Optional[List[str]] = None, max_age: Optional[int] = None, allow_credentials: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword origins: The origins to be allowed via CORS. :paramtype origins: list[str] @@ -126,7 +126,7 @@ class ServiceManagedIdentity(_serialization.Model): "identity": {"key": "identity", "type": "ServiceManagedIdentityIdentity"}, } - def __init__(self, *, identity: Optional["_models.ServiceManagedIdentityIdentity"] = None, **kwargs): + def __init__(self, *, identity: Optional["_models.ServiceManagedIdentityIdentity"] = None, **kwargs: Any) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -165,7 +165,7 @@ class ResourceCore(_serialization.Model): "etag": {"key": "etag", "type": "str"}, } - def __init__(self, *, etag: Optional[str] = None, **kwargs): + def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None: """ :keyword etag: An etag associated with the resource, used for optimistic concurrency when editing it. @@ -210,7 +210,7 @@ class LocationBasedResource(ResourceCore): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, etag: Optional[str] = None, location: Optional[str] = None, **kwargs): + def __init__(self, *, etag: Optional[str] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword etag: An etag associated with the resource, used for optimistic concurrency when editing it. @@ -233,7 +233,7 @@ class ResourceTags(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -283,8 +283,8 @@ def __init__( etag: Optional[str] = None, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword etag: An etag associated with the resource, used for optimistic concurrency when editing it. @@ -344,6 +344,9 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t :ivar public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Known values are: "Enabled" and "Disabled". :vartype public_network_access: str or ~azure.mgmt.healthcareapis.models.PublicNetworkAccess + :ivar event_state: DICOM Service event support status. Known values are: "Disabled", "Enabled", + and "Updating". + :vartype event_state: str or ~azure.mgmt.healthcareapis.models.ServiceEventState """ _validation = { @@ -354,6 +357,7 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t "provisioning_state": {"readonly": True}, "service_url": {"readonly": True}, "private_endpoint_connections": {"readonly": True}, + "event_state": {"readonly": True}, } _attribute_map = { @@ -377,6 +381,7 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t "type": "[PrivateEndpointConnection]", }, "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "event_state": {"key": "properties.eventState", "type": "str"}, } def __init__( @@ -389,8 +394,8 @@ def __init__( authentication_configuration: Optional["_models.DicomServiceAuthenticationConfiguration"] = None, cors_configuration: Optional["_models.CorsConfiguration"] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -420,6 +425,7 @@ def __init__( self.service_url = None self.private_endpoint_connections = None self.public_network_access = public_network_access + self.event_state = None self.id = None self.name = None self.type = None @@ -449,7 +455,7 @@ class DicomServiceAuthenticationConfiguration(_serialization.Model): "audiences": {"key": "audiences", "type": "[str]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.authority = None @@ -471,8 +477,8 @@ class DicomServiceCollection(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.DicomService"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.DicomService"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of Dicom Services. :paramtype next_link: str @@ -504,8 +510,8 @@ def __init__( *, identity: Optional["_models.ServiceManagedIdentityIdentity"] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -529,7 +535,7 @@ class Error(_serialization.Model): "error": {"key": "error", "type": "ErrorDetailsInternal"}, } - def __init__(self, *, error: Optional["_models.ErrorDetailsInternal"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetailsInternal"] = None, **kwargs: Any) -> None: """ :keyword error: Error details. :paramtype error: ~azure.mgmt.healthcareapis.models.ErrorDetailsInternal @@ -549,7 +555,7 @@ class ErrorDetails(_serialization.Model): "error": {"key": "error", "type": "ErrorDetailsInternal"}, } - def __init__(self, *, error: Optional["_models.ErrorDetailsInternal"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetailsInternal"] = None, **kwargs: Any) -> None: """ :keyword error: Error details. :paramtype error: ~azure.mgmt.healthcareapis.models.ErrorDetailsInternal @@ -583,7 +589,7 @@ class ErrorDetailsInternal(_serialization.Model): "target": {"key": "target", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -620,8 +626,6 @@ class FhirService(TaggedResource, ServiceManagedIdentity): # pylint: disable=to "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", and "SystemMaintenance". :vartype provisioning_state: str or ~azure.mgmt.healthcareapis.models.ProvisioningState - :ivar access_policies: Fhir Service access policies. - :vartype access_policies: list[~azure.mgmt.healthcareapis.models.FhirServiceAccessPolicyEntry] :ivar acr_configuration: Fhir Service Azure container registry configuration. :vartype acr_configuration: ~azure.mgmt.healthcareapis.models.FhirServiceAcrConfiguration :ivar authentication_configuration: Fhir Service authentication configuration. @@ -646,6 +650,9 @@ class FhirService(TaggedResource, ServiceManagedIdentity): # pylint: disable=to ~azure.mgmt.healthcareapis.models.ResourceVersionPolicyConfiguration :ivar import_configuration: Fhir Service import configuration. :vartype import_configuration: ~azure.mgmt.healthcareapis.models.FhirServiceImportConfiguration + :ivar implementation_guides_configuration: Implementation Guides configuration. + :vartype implementation_guides_configuration: + ~azure.mgmt.healthcareapis.models.ImplementationGuidesConfiguration """ _validation = { @@ -669,7 +676,6 @@ class FhirService(TaggedResource, ServiceManagedIdentity): # pylint: disable=to "kind": {"key": "kind", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "access_policies": {"key": "properties.accessPolicies", "type": "[FhirServiceAccessPolicyEntry]"}, "acr_configuration": {"key": "properties.acrConfiguration", "type": "FhirServiceAcrConfiguration"}, "authentication_configuration": { "key": "properties.authenticationConfiguration", @@ -688,6 +694,10 @@ class FhirService(TaggedResource, ServiceManagedIdentity): # pylint: disable=to "type": "ResourceVersionPolicyConfiguration", }, "import_configuration": {"key": "properties.importConfiguration", "type": "FhirServiceImportConfiguration"}, + "implementation_guides_configuration": { + "key": "properties.implementationGuidesConfiguration", + "type": "ImplementationGuidesConfiguration", + }, } def __init__( @@ -698,7 +708,6 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, kind: Optional[Union[str, "_models.FhirServiceKind"]] = None, - access_policies: Optional[List["_models.FhirServiceAccessPolicyEntry"]] = None, acr_configuration: Optional["_models.FhirServiceAcrConfiguration"] = None, authentication_configuration: Optional["_models.FhirServiceAuthenticationConfiguration"] = None, cors_configuration: Optional["_models.FhirServiceCorsConfiguration"] = None, @@ -706,8 +715,9 @@ def __init__( public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, resource_version_policy_configuration: Optional["_models.ResourceVersionPolicyConfiguration"] = None, import_configuration: Optional["_models.FhirServiceImportConfiguration"] = None, - **kwargs - ): + implementation_guides_configuration: Optional["_models.ImplementationGuidesConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -721,9 +731,6 @@ def __init__( :paramtype tags: dict[str, str] :keyword kind: The kind of the service. Known values are: "fhir-Stu3" and "fhir-R4". :paramtype kind: str or ~azure.mgmt.healthcareapis.models.FhirServiceKind - :keyword access_policies: Fhir Service access policies. - :paramtype access_policies: - list[~azure.mgmt.healthcareapis.models.FhirServiceAccessPolicyEntry] :keyword acr_configuration: Fhir Service Azure container registry configuration. :paramtype acr_configuration: ~azure.mgmt.healthcareapis.models.FhirServiceAcrConfiguration :keyword authentication_configuration: Fhir Service authentication configuration. @@ -743,13 +750,15 @@ def __init__( :keyword import_configuration: Fhir Service import configuration. :paramtype import_configuration: ~azure.mgmt.healthcareapis.models.FhirServiceImportConfiguration + :keyword implementation_guides_configuration: Implementation Guides configuration. + :paramtype implementation_guides_configuration: + ~azure.mgmt.healthcareapis.models.ImplementationGuidesConfiguration """ super().__init__(etag=etag, location=location, tags=tags, identity=identity, **kwargs) self.identity = identity self.kind = kind self.system_data = None self.provisioning_state = None - self.access_policies = access_policies self.acr_configuration = acr_configuration self.authentication_configuration = authentication_configuration self.cors_configuration = cors_configuration @@ -759,6 +768,7 @@ def __init__( self.event_state = None self.resource_version_policy_configuration = resource_version_policy_configuration self.import_configuration = import_configuration + self.implementation_guides_configuration = implementation_guides_configuration self.id = None self.name = None self.type = None @@ -767,37 +777,6 @@ def __init__( self.tags = tags -class FhirServiceAccessPolicyEntry(_serialization.Model): - """An access policy entry. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: An Azure AD object ID (User or Apps) that is allowed access to the FHIR - service. Required. - :vartype object_id: str - """ - - _validation = { - "object_id": { - "required": True, - "pattern": r"^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$", - }, - } - - _attribute_map = { - "object_id": {"key": "objectId", "type": "str"}, - } - - def __init__(self, *, object_id: str, **kwargs): - """ - :keyword object_id: An Azure AD object ID (User or Apps) that is allowed access to the FHIR - service. Required. - :paramtype object_id: str - """ - super().__init__(**kwargs) - self.object_id = object_id - - class FhirServiceAcrConfiguration(_serialization.Model): """Azure container registry configuration information. @@ -817,8 +796,8 @@ def __init__( *, login_servers: Optional[List[str]] = None, oci_artifacts: Optional[List["_models.ServiceOciArtifactEntry"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword login_servers: The list of the Azure container registry login servers. :paramtype login_servers: list[str] @@ -853,8 +832,8 @@ def __init__( authority: Optional[str] = None, audience: Optional[str] = None, smart_proxy_enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authority: The authority url for the service. :paramtype authority: str @@ -884,8 +863,8 @@ class FhirServiceCollection(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.FhirService"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.FhirService"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of Fhir Services. :paramtype next_link: str @@ -932,8 +911,8 @@ def __init__( methods: Optional[List[str]] = None, max_age: Optional[int] = None, allow_credentials: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword origins: The origins to be allowed via CORS. :paramtype origins: list[str] @@ -965,7 +944,7 @@ class FhirServiceExportConfiguration(_serialization.Model): "storage_account_name": {"key": "storageAccountName", "type": "str"}, } - def __init__(self, *, storage_account_name: Optional[str] = None, **kwargs): + def __init__(self, *, storage_account_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword storage_account_name: The name of the default export storage account. :paramtype storage_account_name: str @@ -997,8 +976,8 @@ def __init__( integration_data_store: Optional[str] = None, initial_import_mode: Optional[bool] = None, enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword integration_data_store: The name of the default integration storage account. :paramtype integration_data_store: str @@ -1033,8 +1012,8 @@ def __init__( *, identity: Optional["_models.ServiceManagedIdentityIdentity"] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -1047,6 +1026,27 @@ def __init__( self.tags = tags +class ImplementationGuidesConfiguration(_serialization.Model): + """The settings for Implementation Guides - defining capabilities for national standards, vendor + consortiums, clinical societies, etc. + + :ivar us_core_missing_data: If US Core Missing Data requirement is enabled. + :vartype us_core_missing_data: bool + """ + + _attribute_map = { + "us_core_missing_data": {"key": "usCoreMissingData", "type": "bool"}, + } + + def __init__(self, *, us_core_missing_data: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword us_core_missing_data: If US Core Missing Data requirement is enabled. + :paramtype us_core_missing_data: bool + """ + super().__init__(**kwargs) + self.us_core_missing_data = us_core_missing_data + + class IotConnector(TaggedResource, ServiceManagedIdentity): # pylint: disable=too-many-instance-attributes """IoT Connector definition. @@ -1115,8 +1115,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, ingestion_endpoint_configuration: Optional["_models.IotEventHubIngestionEndpointConfiguration"] = None, device_mapping: Optional["_models.IotMappingProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -1163,8 +1163,8 @@ class IotConnectorCollection(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.IotConnector"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.IotConnector"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of IoT Connectors. :paramtype next_link: str @@ -1196,8 +1196,8 @@ def __init__( *, identity: Optional["_models.ServiceManagedIdentityIdentity"] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Setting indicating whether the service has a managed identity associated with it. @@ -1229,7 +1229,7 @@ class IotDestinationProperties(_serialization.Model): "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provisioning_state = None @@ -1259,8 +1259,8 @@ def __init__( event_hub_name: Optional[str] = None, consumer_group: Optional[str] = None, fully_qualified_event_hub_namespace: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword event_hub_name: Event Hub name to connect to. :paramtype event_hub_name: str @@ -1343,8 +1343,8 @@ def __init__( fhir_mapping: "_models.IotMappingProperties", etag: Optional[str] = None, location: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword etag: An etag associated with the resource, used for optimistic concurrency when editing it. @@ -1384,8 +1384,12 @@ class IotFhirDestinationCollection(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.IotFhirDestination"]] = None, **kwargs - ): + self, + *, + next_link: Optional[str] = None, + value: Optional[List["_models.IotFhirDestination"]] = None, + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of IoT FHIR destinations. :paramtype next_link: str @@ -1439,8 +1443,8 @@ def __init__( resource_identity_resolution_type: Union[str, "_models.IotIdentityResolutionType"], fhir_service_resource_id: str, fhir_mapping: "_models.IotMappingProperties", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_identity_resolution_type: Determines how resource identity is resolved on the destination. Required. Known values are: "Create" and "Lookup". @@ -1469,7 +1473,7 @@ class IotMappingProperties(_serialization.Model): "content": {"key": "content", "type": "object"}, } - def __init__(self, *, content: Optional[JSON] = None, **kwargs): + def __init__(self, *, content: Optional[JSON] = None, **kwargs: Any) -> None: """ :keyword content: The mapping. :paramtype content: JSON @@ -1499,7 +1503,7 @@ class ListOperations(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. @@ -1533,8 +1537,8 @@ def __init__( name: Optional[str] = None, display_name: Optional[str] = None, blob_duration: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the log. :paramtype name: str @@ -1573,8 +1577,8 @@ def __init__( name: Optional[str] = None, display_name: Optional[str] = None, to_be_exported_for_shoebox: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the dimension. :paramtype name: str @@ -1668,8 +1672,8 @@ def __init__( source_mdm_namespace: Optional[str] = None, enable_regional_mdm_account: Optional[bool] = None, resource_id_dimension_name_override: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the metric. :paramtype name: str @@ -1768,8 +1772,8 @@ def __init__( *, display: Optional["_models.OperationDisplay"] = None, properties: Optional["_models.OperationProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword display: Display of the operation. :paramtype display: ~azure.mgmt.healthcareapis.models.OperationDisplay @@ -1814,7 +1818,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1834,7 +1838,9 @@ class OperationProperties(_serialization.Model): "service_specification": {"key": "serviceSpecification", "type": "ServiceSpecification"}, } - def __init__(self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs): + def __init__( + self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs: Any + ) -> None: """ :keyword service_specification: Service specifications of the operation. :paramtype service_specification: ~azure.mgmt.healthcareapis.models.ServiceSpecification @@ -1880,7 +1886,7 @@ class OperationResultsDescription(_serialization.Model): "properties": {"key": "properties", "type": "object"}, } - def __init__(self, *, properties: Optional[JSON] = None, **kwargs): + def __init__(self, *, properties: Optional[JSON] = None, **kwargs: Any) -> None: """ :keyword properties: Additional properties of the operation result. :paramtype properties: JSON @@ -1911,7 +1917,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1944,7 +1950,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -2001,8 +2007,8 @@ def __init__( *, private_endpoint: Optional["_models.PrivateEndpoint"] = None, private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The resource of private end point. :paramtype private_endpoint: ~azure.mgmt.healthcareapis.models.PrivateEndpoint @@ -2070,8 +2076,8 @@ def __init__( *, private_endpoint: Optional["_models.PrivateEndpoint"] = None, private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The resource of private end point. :paramtype private_endpoint: ~azure.mgmt.healthcareapis.models.PrivateEndpoint @@ -2099,7 +2105,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.healthcareapis.models.PrivateEndpointConnection] @@ -2119,7 +2125,9 @@ class PrivateEndpointConnectionListResultDescription(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnectionDescription]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnectionDescription"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.PrivateEndpointConnectionDescription"]] = None, **kwargs: Any + ) -> None: """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription] @@ -2166,7 +2174,7 @@ class PrivateLinkResource(Resource): "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, } - def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs): + def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword required_zone_names: The private link resource Private link DNS zone name. :paramtype required_zone_names: list[str] @@ -2219,7 +2227,7 @@ class PrivateLinkResourceDescription(PrivateLinkResource): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs): + def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword required_zone_names: The private link resource Private link DNS zone name. :paramtype required_zone_names: list[str] @@ -2239,7 +2247,9 @@ class PrivateLinkResourceListResultDescription(_serialization.Model): "value": {"key": "value", "type": "[PrivateLinkResourceDescription]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateLinkResourceDescription"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.PrivateLinkResourceDescription"]] = None, **kwargs: Any + ) -> None: """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.healthcareapis.models.PrivateLinkResourceDescription] @@ -2249,7 +2259,8 @@ def __init__(self, *, value: Optional[List["_models.PrivateLinkResourceDescripti class PrivateLinkServiceConnectionState(_serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. + """A collection of information about the state of the connection between service consumer and + provider. :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Known values are: "Pending", "Approved", and "Rejected". @@ -2274,8 +2285,8 @@ def __init__( status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, description: Optional[str] = None, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Known values are: "Pending", "Approved", and "Rejected". @@ -2314,8 +2325,8 @@ def __init__( *, default: Optional[Union[str, "_models.FhirResourceVersionPolicy"]] = None, resource_type_overrides: Optional[Dict[str, Union[str, "_models.FhirResourceVersionPolicy"]]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword default: The default value for tracking history across all resources. Known values are: "no-version", "versioned", and "versioned-update". @@ -2350,7 +2361,7 @@ class ServiceAccessPolicyEntry(_serialization.Model): "object_id": {"key": "objectId", "type": "str"}, } - def __init__(self, *, object_id: str, **kwargs): + def __init__(self, *, object_id: str, **kwargs: Any) -> None: """ :keyword object_id: An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. Required. @@ -2379,8 +2390,8 @@ def __init__( *, login_servers: Optional[List[str]] = None, oci_artifacts: Optional[List["_models.ServiceOciArtifactEntry"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword login_servers: The list of the ACR login servers. :paramtype login_servers: list[str] @@ -2415,8 +2426,8 @@ def __init__( authority: Optional[str] = None, audience: Optional[str] = None, smart_proxy_enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authority: The authority url for the service. :paramtype authority: str @@ -2466,8 +2477,8 @@ def __init__( methods: Optional[List[str]] = None, max_age: Optional[int] = None, allow_credentials: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword origins: The origins to be allowed via CORS. :paramtype origins: list[str] @@ -2495,27 +2506,45 @@ class ServiceCosmosDbConfigurationInfo(_serialization.Model): :vartype offer_throughput: int :ivar key_vault_key_uri: The URI of the customer-managed key for the backing database. :vartype key_vault_key_uri: str + :ivar cross_tenant_cmk_application_id: The multi-tenant application id used to enable CMK + access for services in a data sovereign region. + :vartype cross_tenant_cmk_application_id: str """ _validation = { - "offer_throughput": {"maximum": 10000, "minimum": 400}, + "offer_throughput": {"minimum": 400}, + "cross_tenant_cmk_application_id": { + "pattern": r"^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$" + }, } _attribute_map = { "offer_throughput": {"key": "offerThroughput", "type": "int"}, "key_vault_key_uri": {"key": "keyVaultKeyUri", "type": "str"}, + "cross_tenant_cmk_application_id": {"key": "crossTenantCmkApplicationId", "type": "str"}, } - def __init__(self, *, offer_throughput: Optional[int] = None, key_vault_key_uri: Optional[str] = None, **kwargs): + def __init__( + self, + *, + offer_throughput: Optional[int] = None, + key_vault_key_uri: Optional[str] = None, + cross_tenant_cmk_application_id: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword offer_throughput: The provisioned throughput for the backing database. :paramtype offer_throughput: int :keyword key_vault_key_uri: The URI of the customer-managed key for the backing database. :paramtype key_vault_key_uri: str + :keyword cross_tenant_cmk_application_id: The multi-tenant application id used to enable CMK + access for services in a data sovereign region. + :paramtype cross_tenant_cmk_application_id: str """ super().__init__(**kwargs) self.offer_throughput = offer_throughput self.key_vault_key_uri = key_vault_key_uri + self.cross_tenant_cmk_application_id = cross_tenant_cmk_application_id class ServiceExportConfigurationInfo(_serialization.Model): @@ -2529,7 +2558,7 @@ class ServiceExportConfigurationInfo(_serialization.Model): "storage_account_name": {"key": "storageAccountName", "type": "str"}, } - def __init__(self, *, storage_account_name: Optional[str] = None, **kwargs): + def __init__(self, *, storage_account_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword storage_account_name: The name of the default export storage account. :paramtype storage_account_name: str @@ -2561,8 +2590,8 @@ def __init__( integration_data_store: Optional[str] = None, initial_import_mode: Optional[bool] = None, enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword integration_data_store: The name of the default integration storage account. :paramtype integration_data_store: str @@ -2620,8 +2649,8 @@ def __init__( *, type: Union[str, "_models.ServiceManagedIdentityType"], user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: Type of identity being specified, currently SystemAssigned and None are allowed. Required. Known values are: "None", "SystemAssigned", "UserAssigned", and @@ -2664,8 +2693,8 @@ def __init__( login_server: Optional[str] = None, image_name: Optional[str] = None, digest: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword login_server: The Azure Container Registry login server. :paramtype login_server: str @@ -2735,8 +2764,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, etag: Optional[str] = None, identity: Optional["_models.ServicesResourceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword kind: The kind of the service. Required. Known values are: "fhir", "fhir-Stu3", and "fhir-R4". @@ -2826,8 +2855,8 @@ def __init__( etag: Optional[str] = None, identity: Optional["_models.ServicesResourceIdentity"] = None, properties: Optional["_models.ServicesProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword kind: The kind of the service. Required. Known values are: "fhir", "fhir-Stu3", and "fhir-R4". @@ -2865,8 +2894,12 @@ class ServicesDescriptionListResult(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.ServicesDescription"]] = None, **kwargs - ): + self, + *, + next_link: Optional[str] = None, + value: Optional[List["_models.ServicesDescription"]] = None, + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of service description objects. :paramtype next_link: str @@ -2902,7 +2935,7 @@ class ServicesNameAvailabilityInfo(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, message: Optional[str] = None, **kwargs): + def __init__(self, *, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword message: The detailed reason message. :paramtype message: str @@ -2933,8 +2966,8 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Instance tags. :paramtype tags: dict[str, str] @@ -2966,8 +2999,8 @@ def __init__( *, log_specifications: Optional[List["_models.LogSpecification"]] = None, metric_specifications: Optional[List["_models.MetricSpecification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword log_specifications: Specifications of the Log for Azure Monitoring. :paramtype log_specifications: list[~azure.mgmt.healthcareapis.models.LogSpecification] @@ -3046,8 +3079,8 @@ def __init__( public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, acr_configuration: Optional["_models.ServiceAcrConfigurationInfo"] = None, import_configuration: Optional["_models.ServiceImportConfigurationInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword access_policies: The access policies of the service instance. :paramtype access_policies: list[~azure.mgmt.healthcareapis.models.ServiceAccessPolicyEntry] @@ -3115,7 +3148,9 @@ class ServicesResourceIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, **kwargs): + def __init__( + self, *, type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, **kwargs: Any + ) -> None: """ :keyword type: Type of identity being specified, currently SystemAssigned and None are allowed. Known values are: "SystemAssigned" and "None". @@ -3164,8 +3199,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -3212,7 +3247,7 @@ class UserAssignedIdentity(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None @@ -3268,8 +3303,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.WorkspaceProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword etag: An etag associated with the resource, used for optimistic concurrency when editing it. @@ -3300,7 +3335,9 @@ class WorkspaceList(_serialization.Model): "value": {"key": "value", "type": "[Workspace]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["_models.Workspace"]] = None, **kwargs): + def __init__( + self, *, next_link: Optional[str] = None, value: Optional[List["_models.Workspace"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page. :paramtype next_link: str @@ -3323,7 +3360,7 @@ class WorkspacePatchResource(ResourceTags): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3360,7 +3397,9 @@ class WorkspaceProperties(_serialization.Model): "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, } - def __init__(self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs): + def __init__( + self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any + ) -> None: """ :keyword public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Known values are: "Enabled" and "Disabled". diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_dicom_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_dicom_services_operations.py index 920e9ebbd897..dec6d916d670 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_dicom_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_dicom_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,11 +57,11 @@ def build_list_by_workspace_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,14 +90,14 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "dicomServiceName": _SERIALIZER.url( "dicom_service_name", dicom_service_name, "str", max_length=24, min_length=3 ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,14 +127,14 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "dicomServiceName": _SERIALIZER.url( "dicom_service_name", dicom_service_name, "str", max_length=24, min_length=3 ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +153,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,14 +166,14 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "dicomServiceName": _SERIALIZER.url( "dicom_service_name", dicom_service_name, "str", max_length=24, min_length=3 ), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,7 +192,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +201,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -215,7 +211,7 @@ def build_delete_request( "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -264,9 +260,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DicomServiceCollection] = kwargs.pop("cls", None) error_map = { @@ -320,8 +314,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -367,9 +362,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DicomService] = kwargs.pop("cls", None) request = build_get_request( @@ -385,8 +378,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,16 +420,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dicomservice, (IO, bytes)): + if isinstance(dicomservice, (IOBase, bytes)): _content = dicomservice else: _json = self._serialize.body(dicomservice, "DicomService") @@ -456,8 +448,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +577,7 @@ def begin_create_or_update( :param dicom_service_name: The name of DICOM Service resource. Required. :type dicom_service_name: str :param dicomservice: The parameters for creating or updating a Dicom Service resource. Is - either a model type or a IO type. Required. + either a DicomService type or a IO type. Required. :type dicomservice: ~azure.mgmt.healthcareapis.models.DicomService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -605,9 +598,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -672,16 +663,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dicomservice_patch_resource, (IO, bytes)): + if isinstance(dicomservice_patch_resource, (IOBase, bytes)): _content = dicomservice_patch_resource else: _json = self._serialize.body(dicomservice_patch_resource, "DicomServicePatchResource") @@ -702,8 +691,9 @@ def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -825,7 +815,7 @@ def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param dicomservice_patch_resource: The parameters for updating a Dicom Service. Is either a - model type or a IO type. Required. + DicomServicePatchResource type or a IO type. Required. :type dicomservice_patch_resource: ~azure.mgmt.healthcareapis.models.DicomServicePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -847,9 +837,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.DicomService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -909,9 +897,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -927,8 +913,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -973,9 +960,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_destinations_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_destinations_operations.py index 7f7f68bb940a..c3c7bcd4e99f 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_destinations_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_destinations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -28,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_by_iot_connector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,14 +54,14 @@ def build_list_by_iot_connector_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,9 +112,7 @@ def list_by_iot_connector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotFhirDestinationCollection] = kwargs.pop("cls", None) error_map = { @@ -174,8 +167,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_services_operations.py index 6e192bd40833..aafef4bc73c7 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_fhir_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,11 +57,11 @@ def build_list_by_workspace_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,12 +90,12 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "fhirServiceName": _SERIALIZER.url("fhir_service_name", fhir_service_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,12 +125,12 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "fhirServiceName": _SERIALIZER.url("fhir_service_name", fhir_service_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,7 +149,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -166,12 +162,12 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "fhirServiceName": _SERIALIZER.url("fhir_service_name", fhir_service_name, "str", max_length=24, min_length=3), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +186,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +195,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -207,7 +203,7 @@ def build_delete_request( "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,9 +252,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FhirServiceCollection] = kwargs.pop("cls", None) error_map = { @@ -312,8 +306,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -359,9 +354,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FhirService] = kwargs.pop("cls", None) request = build_get_request( @@ -377,8 +370,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -418,16 +412,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(fhirservice, (IO, bytes)): + if isinstance(fhirservice, (IOBase, bytes)): _content = fhirservice else: _json = self._serialize.body(fhirservice, "FhirService") @@ -448,8 +440,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -574,7 +567,7 @@ def begin_create_or_update( :param fhir_service_name: The name of FHIR Service resource. Required. :type fhir_service_name: str :param fhirservice: The parameters for creating or updating a Fhir Service resource. Is either - a model type or a IO type. Required. + a FhirService type or a IO type. Required. :type fhirservice: ~azure.mgmt.healthcareapis.models.FhirService or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -595,9 +588,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -662,16 +653,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(fhirservice_patch_resource, (IO, bytes)): + if isinstance(fhirservice_patch_resource, (IOBase, bytes)): _content = fhirservice_patch_resource else: _json = self._serialize.body(fhirservice_patch_resource, "FhirServicePatchResource") @@ -692,8 +681,9 @@ def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,7 +805,7 @@ def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param fhirservice_patch_resource: The parameters for updating a Fhir Service. Is either a - model type or a IO type. Required. + FhirServicePatchResource type or a IO type. Required. :type fhirservice_patch_resource: ~azure.mgmt.healthcareapis.models.FhirServicePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -837,9 +827,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.FhirService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -899,9 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -917,8 +903,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -963,9 +950,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connector_fhir_destination_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connector_fhir_destination_operations.py index 385025c84ce3..c3242044bf7e 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connector_fhir_destination_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connector_fhir_destination_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,12 +28,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +60,7 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 @@ -74,7 +70,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,7 +92,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -109,7 +105,7 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 @@ -119,7 +115,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,7 +139,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +148,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -165,7 +161,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotFhirDestination] = kwargs.pop("cls", None) request = build_get_request( @@ -250,8 +244,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -292,16 +287,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotFhirDestination] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_fhir_destination, (IO, bytes)): + if isinstance(iot_fhir_destination, (IOBase, bytes)): _content = iot_fhir_destination else: _json = self._serialize.body(iot_fhir_destination, "IotFhirDestination") @@ -323,8 +316,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -460,7 +454,7 @@ def begin_create_or_update( :param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required. :type fhir_destination_name: str :param iot_fhir_destination: The parameters for creating or updating an IoT Connector FHIR - destination resource. Is either a model type or a IO type. Required. + destination resource. Is either a IotFhirDestination type or a IO type. Required. :type iot_fhir_destination: ~azure.mgmt.healthcareapis.models.IotFhirDestination or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -481,9 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotFhirDestination] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -549,9 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -568,8 +558,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -621,9 +612,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connectors_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connectors_operations.py index 001917c85d1e..67c97f90505f 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connectors_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_iot_connectors_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,11 +57,11 @@ def build_list_by_workspace_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,14 +90,14 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,14 +127,14 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +153,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,14 +166,14 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "iotConnectorName": _SERIALIZER.url( "iot_connector_name", iot_connector_name, "str", max_length=24, min_length=3 ), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,7 +192,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +201,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -215,7 +211,7 @@ def build_delete_request( "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -264,9 +260,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotConnectorCollection] = kwargs.pop("cls", None) error_map = { @@ -320,8 +314,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -367,9 +362,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IotConnector] = kwargs.pop("cls", None) request = build_get_request( @@ -385,8 +378,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,16 +420,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_connector, (IO, bytes)): + if isinstance(iot_connector, (IOBase, bytes)): _content = iot_connector else: _json = self._serialize.body(iot_connector, "IotConnector") @@ -456,8 +448,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +577,7 @@ def begin_create_or_update( :param iot_connector_name: The name of IoT Connector resource. Required. :type iot_connector_name: str :param iot_connector: The parameters for creating or updating an IoT Connectors resource. Is - either a model type or a IO type. Required. + either a IotConnector type or a IO type. Required. :type iot_connector: ~azure.mgmt.healthcareapis.models.IotConnector or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -605,9 +598,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -672,16 +663,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(iot_connector_patch_resource, (IO, bytes)): + if isinstance(iot_connector_patch_resource, (IOBase, bytes)): _content = iot_connector_patch_resource else: _json = self._serialize.body(iot_connector_patch_resource, "IotConnectorPatchResource") @@ -702,8 +691,9 @@ def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -825,7 +815,7 @@ def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param iot_connector_patch_resource: The parameters for updating an IoT Connector. Is either a - model type or a IO type. Required. + IotConnectorPatchResource type or a IO type. Required. :type iot_connector_patch_resource: ~azure.mgmt.healthcareapis.models.IotConnectorPatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -847,9 +837,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.IotConnector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -909,9 +897,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -927,8 +913,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -973,9 +960,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py index bd7635d72045..e0d62b298726 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operation_results_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +38,7 @@ def build_get_request(location_name: str, operation_result_id: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,12 +47,12 @@ def build_get_request(location_name: str, operation_result_id: str, subscription "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "locationName": _SERIALIZER.url("location_name", location_name, "str"), "operationResultId": _SERIALIZER.url("operation_result_id", operation_result_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,9 +106,7 @@ def get(self, location_name: str, operation_result_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationResultsDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -128,8 +121,9 @@ def get(self, location_name: str, operation_result_id: str, **kwargs: Any) -> _m 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py index 683ed9ccd32e..69f077e3016c 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +86,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListOperations] = kwargs.pop("cls", None) error_map = { @@ -144,8 +137,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_endpoint_connections_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_endpoint_connections_operations.py index d1b5dbd8d55c..391d9f4804e1 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_endpoint_connections_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_by_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,14 +54,14 @@ def build_list_by_service_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +91,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -105,7 +101,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +132,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -146,7 +142,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,7 +165,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +174,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -188,7 +184,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,9 +235,7 @@ def list_by_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -295,8 +289,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,9 +338,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -361,8 +354,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -402,16 +396,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "PrivateEndpointConnection") @@ -432,8 +424,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,8 +548,8 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Is either a model type or a IO - type. Required. + :param properties: The private endpoint connection properties. Is either a + PrivateEndpointConnection type or a IO type. Required. :type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -578,9 +571,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -640,9 +631,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -658,8 +647,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -705,9 +695,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_link_resources_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_link_resources_operations.py index 67eafdd41531..4438826677e4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_link_resources_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_by_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,14 +49,14 @@ def build_list_by_service_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +73,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +82,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -95,7 +90,7 @@ def build_get_request( "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,9 +147,7 @@ def list_by_service( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResultDescription] = kwargs.pop("cls", None) request = build_list_by_service_request( @@ -169,8 +162,9 @@ def list_by_service( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -220,9 +214,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -238,8 +230,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py index af24d1e501da..64e208ec9ddc 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_services_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +43,7 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,14 +52,14 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,14 +86,14 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,14 +122,14 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,14 +157,14 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,16 +179,16 @@ def build_list_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: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -207,7 +203,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,13 +212,13 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -237,7 +233,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: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -246,10 +242,10 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -306,9 +302,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -323,8 +317,9 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -363,16 +358,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(service_description, (IO, bytes)): + if isinstance(service_description, (IOBase, bytes)): _content = service_description else: _json = self._serialize.body(service_description, "ServicesDescription") @@ -392,8 +385,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -505,8 +499,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the service instance. Required. :type resource_name: str - :param service_description: The service instance metadata. Is either a model type or a IO type. - Required. + :param service_description: The service instance metadata. Is either a ServicesDescription type + or a IO type. Required. :type service_description: ~azure.mgmt.healthcareapis.models.ServicesDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -527,9 +521,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -592,16 +584,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(service_patch_description, (IO, bytes)): + if isinstance(service_patch_description, (IOBase, bytes)): _content = service_patch_description else: _json = self._serialize.body(service_patch_description, "ServicesPatchDescription") @@ -621,8 +611,9 @@ def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -733,7 +724,7 @@ def begin_update( :param resource_name: The name of the service instance. Required. :type resource_name: str :param service_patch_description: The service instance metadata and security metadata. Is - either a model type or a IO type. Required. + either a ServicesPatchDescription type or a IO type. Required. :type service_patch_description: ~azure.mgmt.healthcareapis.models.ServicesPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -755,9 +746,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesDescription] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -816,9 +805,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -833,8 +820,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -875,9 +863,7 @@ def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -929,9 +915,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ServicesDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -983,8 +967,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,9 +1001,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServicesDescriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -1071,8 +1054,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1140,7 +1124,7 @@ def check_name_availability( :param check_name_availability_inputs: Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. Is - either a model type or a IO type. Required. + either a CheckNameAvailabilityParameters type or a IO type. Required. :type check_name_availability_inputs: ~azure.mgmt.healthcareapis.models.CheckNameAvailabilityParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1162,16 +1146,14 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.ServicesNameAvailabilityInfo] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_inputs, (IO, bytes)): + if isinstance(check_name_availability_inputs, (IOBase, bytes)): _content = check_name_availability_inputs else: _json = self._serialize.body(check_name_availability_inputs, "CheckNameAvailabilityParameters") @@ -1189,8 +1171,9 @@ def check_name_availability( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_endpoint_connections_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_endpoint_connections_operations.py index b9ca438ba509..1574a49bcac5 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_endpoint_connections_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +45,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,14 +54,14 @@ def build_list_by_workspace_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +91,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -105,7 +101,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +132,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -146,7 +142,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,7 +165,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +174,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -188,7 +184,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,9 +235,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -295,8 +289,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,9 +338,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -361,8 +354,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -402,16 +396,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "PrivateEndpointConnectionDescription") @@ -432,8 +424,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,8 +548,8 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Is either a model type or a IO - type. Required. + :param properties: The private endpoint connection properties. Is either a + PrivateEndpointConnectionDescription type or a IO type. Required. :type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -578,9 +571,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.PrivateEndpointConnectionDescription] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -640,9 +631,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -658,8 +647,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -705,9 +695,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_link_resources_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_link_resources_operations.py index eb6692b3950d..8c78d991b517 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_link_resources_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspace_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -28,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,14 +51,14 @@ def build_list_by_workspace_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +84,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), @@ -97,7 +92,7 @@ def build_get_request( "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,9 +143,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResultDescription] = kwargs.pop("cls", None) error_map = { @@ -204,8 +197,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -251,9 +245,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceDescription] = kwargs.pop("cls", None) request = build_get_request( @@ -269,8 +261,9 @@ def get( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspaces_operations.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspaces_operations.py index a42c837e09fa..8c825db0789a 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspaces_operations.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_workspaces_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,16 +43,16 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,13 +76,13 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,11 +111,11 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,11 +145,11 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,7 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,11 +181,11 @@ def build_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -208,7 +204,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,14 +213,14 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str", max_length=24, min_length=3), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -266,9 +262,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Workspace"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None) error_map = { @@ -320,8 +314,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,9 +348,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None) error_map = { @@ -408,8 +401,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -451,9 +445,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) request = build_get_request( @@ -468,8 +460,9 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -504,16 +497,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workspace, (IO, bytes)): + if isinstance(workspace, (IOBase, bytes)): _content = workspace else: _json = self._serialize.body(workspace, "Workspace") @@ -533,8 +524,9 @@ def _create_or_update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -644,7 +636,7 @@ def begin_create_or_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param workspace: The parameters for creating or updating a healthcare workspace. Is either a - model type or a IO type. Required. + Workspace type or a IO type. Required. :type workspace: ~azure.mgmt.healthcareapis.models.Workspace or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -664,9 +656,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -729,16 +719,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(workspace_patch_resource, (IO, bytes)): + if isinstance(workspace_patch_resource, (IOBase, bytes)): _content = workspace_patch_resource else: _json = self._serialize.body(workspace_patch_resource, "WorkspacePatchResource") @@ -758,8 +746,9 @@ def _update_initial( 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +859,7 @@ def begin_update( :param workspace_name: The name of workspace resource. Required. :type workspace_name: str :param workspace_patch_resource: The parameters for updating a specified workspace. Is either a - model type or a IO type. Required. + WorkspacePatchResource type or a IO type. Required. :type workspace_patch_resource: ~azure.mgmt.healthcareapis.models.WorkspacePatchResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -890,9 +879,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + 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.Workspace] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -951,9 +938,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -968,8 +953,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1010,9 +996,7 @@ def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-06-01"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/check_name_availability_post.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/check_name_availability_post.py index 985e0bc89f48..771cf6f75177 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/check_name_availability_post.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/check_name_availability_post.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/CheckNameAvailabilityPost.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/CheckNameAvailabilityPost.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_create.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_create.py index fcbb6f061b9c..08380f4e6bb4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/dicomservices/DicomServices_Create.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/dicomservices/DicomServices_Create.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_delete.py index d34fd5d9bfe6..a51b2b9beaba 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="subid", ) - response = client.dicom_services.begin_delete( + client.dicom_services.begin_delete( resource_group_name="testRG", dicom_service_name="blue", workspace_name="workspace1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/dicomservices/DicomServices_Delete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/dicomservices/DicomServices_Delete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_get.py index 5394ed133c59..5ec4e66a23a0 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/dicomservices/DicomServices_Get.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/dicomservices/DicomServices_Get.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_list.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_list.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_list.py index 9a65ec1f6864..2533a5711bd4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/dicomservices/DicomServices_List.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/dicomservices/DicomServices_List.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_patch.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_patch.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_patch.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_patch.py index 1dd3ab614d43..90997ec79db1 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicom_services_patch.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/dicomservices/dicom_services_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/dicomservices/DicomServices_Patch.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/dicomservices/DicomServices_Patch.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_create.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_create.py index de7baaa64f45..af0e03b76c78 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_create.py @@ -38,10 +38,6 @@ def main(): "kind": "fhir-R4", "location": "westus", "properties": { - "accessPolicies": [ - {"objectId": "c487e7d1-3210-41a3-8ccc-e9372b78da47"}, - {"objectId": "5b307da8-43d4-492b-8b66-b0294ade872f"}, - ], "acrConfiguration": {"loginServers": ["test1.azurecr.io"]}, "authenticationConfiguration": { "audience": "https://azurehealthcareapis.com", @@ -56,6 +52,7 @@ def main(): "origins": ["*"], }, "exportConfiguration": {"storageAccountName": "existingStorageAccount"}, + "implementationGuidesConfiguration": {"usCoreMissingData": False}, "importConfiguration": { "enabled": False, "initialImportMode": False, @@ -68,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/fhirservices/FhirServices_Create.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/fhirservices/FhirServices_Create.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_delete.py index 62209c2bd4a8..b48db9f0c1ff 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="subid", ) - response = client.fhir_services.begin_delete( + client.fhir_services.begin_delete( resource_group_name="testRG", fhir_service_name="fhirservice1", workspace_name="workspace1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/fhirservices/FhirServices_Delete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/fhirservices/FhirServices_Delete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_get.py index 1996996e169a..5a1610d0654f 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/fhirservices/FhirServices_Get.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/fhirservices/FhirServices_Get.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_list.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_list.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_list.py index 461fc8efd8e9..1157bcc9f2a9 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/fhirservices/FhirServices_List.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/fhirservices/FhirServices_List.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_patch.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_patch.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_patch.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_patch.py index 09366e785120..603469ae7c4a 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhir_services_patch.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/fhirservices/fhir_services_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/fhirservices/FhirServices_Patch.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/fhirservices/FhirServices_Patch.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_create.py similarity index 97% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_create.py index 3ea475726143..6c3d9102238a 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_create.py @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_Create.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_Create.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_delete.py index 67934e95a99a..0d270da19314 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="subid", ) - response = client.iot_connectors.begin_delete( + client.iot_connectors.begin_delete( resource_group_name="testRG", iot_connector_name="blue", workspace_name="workspace1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_Delete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_Delete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_create.py similarity index 98% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_create.py index b6624b01918c..7fe89cd08403 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_create.py @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_fhirdestination_Create.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_delete.py index 437cbc96aab9..9bb78cb39094 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_delete.py @@ -29,15 +29,14 @@ def main(): subscription_id="subid", ) - response = client.iot_connector_fhir_destination.begin_delete( + client.iot_connector_fhir_destination.begin_delete( resource_group_name="testRG", workspace_name="workspace1", iot_connector_name="blue", fhir_destination_name="dest1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_fhirdestination_Delete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_get.py index ac7ca88fd63d..f0693c3e9590 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_fhirdestination_Get.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_list.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_list.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_list.py index f58a318e184d..af79c6b77abe 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_fhirdestination_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_fhirdestination_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_fhirdestination_List.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_fhirdestination_List.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_get.py index 3dd2f8cb01f6..93d350fdbbef 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_Get.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_Get.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_list.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_list.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_list.py index b1c5fafeb664..1e9c113db23d 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_List.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_List.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_patch.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_patch.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_patch.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_patch.py index 18787ae878e1..2b18e49650a7 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnector_patch.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/iotconnectors/iotconnector_patch.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/iotconnectors/iotconnector_Patch.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/iotconnectors/iotconnector_Patch.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resource_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resource_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resource_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resource_get.py index a836964a2bc3..8c06311da3a4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resource_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resource_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/PrivateLinkResourceGet.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/PrivateLinkResourceGet.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_service.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resources_list_by_service.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_service.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resources_list_by_service.py index e594a89ad02d..d1e60fafac5c 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_service.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/private_link_resources_list_by_service.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/PrivateLinkResourcesListByService.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/PrivateLinkResourcesListByService.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create.py similarity index 97% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create.py index 72a8a7d54ebc..4dbc2b78ecb6 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create.py @@ -67,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceCreate.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_in_data_sovereign_region_with_cmk_enabled.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_in_data_sovereign_region_with_cmk_enabled.py new file mode 100644 index 000000000000..a33daabd6b5e --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_in_data_sovereign_region_with_cmk_enabled.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.healthcareapis import HealthcareApisManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-healthcareapis +# USAGE + python service_create_in_data_sovereign_region_with_cmk_enabled.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 = HealthcareApisManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.services.begin_create_or_update( + resource_group_name="rg1", + resource_name="service1", + service_description={ + "identity": {"type": "SystemAssigned"}, + "kind": "fhir-R4", + "location": "Southeast Asia", + "properties": { + "accessPolicies": [ + {"objectId": "c487e7d1-3210-41a3-8ccc-e9372b78da47"}, + {"objectId": "5b307da8-43d4-492b-8b66-b0294ade872f"}, + ], + "authenticationConfiguration": { + "audience": "https://azurehealthcareapis.com", + "authority": "https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc", + "smartProxyEnabled": True, + }, + "corsConfiguration": { + "allowCredentials": False, + "headers": ["*"], + "maxAge": 1440, + "methods": ["DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT"], + "origins": ["*"], + }, + "cosmosDbConfiguration": { + "crossTenantCmkApplicationId": "de3fbeef-8c3a-428e-8b9f-4d229c8a85f4", + "keyVaultKeyUri": "https://my-vault.vault.azure.net/keys/my-key", + "offerThroughput": 1000, + }, + "exportConfiguration": {"storageAccountName": "existingStorageAccount"}, + "privateEndpointConnections": [], + "publicNetworkAccess": "Disabled", + }, + "tags": {}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceCreateInDataSovereignRegionWithCmkEnabled.json +if __name__ == "__main__": + main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_minimum.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_minimum.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_minimum.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_minimum.py index 5bd334c65e42..692c946ac0a5 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_minimum.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_minimum.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceCreateMinimum.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceCreateMinimum.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_private_endpoint_connection.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_private_endpoint_connection.py index e872fae3361e..b1e20a6d53b1 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_create_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_create_private_endpoint_connection.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceCreatePrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete.py index 79812fa3f41a..7e7b6bb56a93 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="subid", ) - response = client.services.begin_delete( + client.services.begin_delete( resource_group_name="rg1", resource_name="service1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceDelete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete_private_endpoint_connection.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete_private_endpoint_connection.py index eea223eeb823..4806aa923f5c 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_delete_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_delete_private_endpoint_connection.py @@ -29,14 +29,13 @@ def main(): subscription_id="subid", ) - response = client.private_endpoint_connections.begin_delete( + client.private_endpoint_connections.begin_delete( resource_group_name="rgname", resource_name="service1", private_endpoint_connection_name="myConnection", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceDeletePrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get.py similarity index 95% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get.py index fc4b72596520..f7bb5b136c85 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceGet.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_in_data_sovereign_region_with_cmk_enabled.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_in_data_sovereign_region_with_cmk_enabled.py new file mode 100644 index 000000000000..8bb14dfbe484 --- /dev/null +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_in_data_sovereign_region_with_cmk_enabled.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.healthcareapis import HealthcareApisManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-healthcareapis +# USAGE + python service_get_in_data_sovereign_region_with_cmk_enabled.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 = HealthcareApisManagementClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.services.get( + resource_group_name="rg1", + resource_name="service1", + ) + print(response) + + +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceGetInDataSovereignRegionWithCmkEnabled.json +if __name__ == "__main__": + main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_private_endpoint_connection.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_private_endpoint_connection.py index d5f7bca11e56..3f0f5f84f32d 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_get_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_get_private_endpoint_connection.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceGetPrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceGetPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list.py similarity index 95% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list.py index fad5778beb19..31f8c71f53a5 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceList.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceList.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_by_resource_group.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_by_resource_group.py similarity index 95% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_by_resource_group.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_by_resource_group.py index 628dd007ba08..b7c8b7a8a6d2 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_by_resource_group.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceListByResourceGroup.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_private_endpoint_connections.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_private_endpoint_connections.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_private_endpoint_connections.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_private_endpoint_connections.py index 37d53334b8bb..5e8c2a12de0d 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_list_private_endpoint_connections.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_list_private_endpoint_connections.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServiceListPrivateEndpointConnections.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServiceListPrivateEndpointConnections.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_patch.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_patch.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_patch.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_patch.py index 2441391a80ea..35264386b317 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/service_patch.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/legacy/service_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/legacy/ServicePatch.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/legacy/ServicePatch.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operation_results_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operation_results_get.py index d986dce157fe..5b9d4ef51f6b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operation_results_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operation_results_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/OperationResultsGet.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/OperationResultsGet.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operations_list.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operations_list.py index 32631bee0b90..658a5c3a95a6 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operations_list.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/OperationsList.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/OperationsList.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_workspace.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/private_link_resources_list_by_workspace.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_workspace.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/private_link_resources_list_by_workspace.py index d8625ade7f30..12d32d4b0799 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/private_link_resources_list_by_workspace.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/private_link_resources_list_by_workspace.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/PrivateLinkResourcesListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_create_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_create_private_endpoint_connection.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_create_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_create_private_endpoint_connection.py index cc58238d961f..7e6a1da368e1 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_create_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_create_private_endpoint_connection.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_delete_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_delete_private_endpoint_connection.py similarity index 90% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_delete_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_delete_private_endpoint_connection.py index 9e36daa5c679..540eab338b65 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_delete_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_delete_private_endpoint_connection.py @@ -29,14 +29,13 @@ def main(): subscription_id="subid", ) - response = client.workspace_private_endpoint_connections.begin_delete( + client.workspace_private_endpoint_connections.begin_delete( resource_group_name="testRG", workspace_name="workspace1", private_endpoint_connection_name="myConnection", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_get_private_endpoint_connection.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_get_private_endpoint_connection.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_get_private_endpoint_connection.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_get_private_endpoint_connection.py index 92046dad2946..af4f04fcbe90 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_get_private_endpoint_connection.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_get_private_endpoint_connection.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_list_private_endpoint_connections.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_list_private_endpoint_connections.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_list_private_endpoint_connections.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_list_private_endpoint_connections.py index b2fbdf96eeac..cef85401cca7 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_list_private_endpoint_connections.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_list_private_endpoint_connections.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/WorkspaceListPrivateEndpointConnections.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_private_link_resource_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_private_link_resource_get.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_private_link_resource_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_private_link_resource_get.py index ca311adc8967..31aa115a9cf4 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspace_private_link_resource_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/privatelink/workspace_private_link_resource_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/privatelink/WorkspacePrivateLinkResourceGet.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_create.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_create.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_create.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_create.py index 2dab29f9ca16..c5a186415634 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_create.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_Create.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_Create.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_delete.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_delete.py similarity index 91% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_delete.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_delete.py index 0f4c33bf176e..15f311b24ebd 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_delete.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="subid", ) - response = client.workspaces.begin_delete( + client.workspaces.begin_delete( resource_group_name="testRG", workspace_name="workspace1", ).result() - print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_Delete.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_Delete.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_get.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_get.py similarity index 95% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_get.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_get.py index a14180f96b02..d448fbe4a5bc 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_get.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_Get.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_Get.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_resource_group.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_resource_group.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_resource_group.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_resource_group.py index f3e69dc3da79..d7498277c3bb 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_resource_group.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_ListByResourceGroup.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_subscription.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_subscription.py similarity index 95% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_subscription.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_subscription.py index 9e106b148711..744524551d2b 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_list_by_subscription.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_ListBySubscription.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_patch.py b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_patch.py similarity index 96% rename from sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_patch.py rename to sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_patch.py index c49834302c14..86073bad924c 100644 --- a/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces_patch.py +++ b/sdk/healthcareapis/azure-mgmt-healthcareapis/generated_samples/workspaces/workspaces_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2022-06-01/examples/workspaces/Workspaces_Patch.json +# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-09-06/examples/workspaces/Workspaces_Patch.json if __name__ == "__main__": main()