зеркало из
1
0
Форкнуть 0

[AutoRelease] t2-healthcareapis-2024-03-23-02777(can only be merged by SDK owner) (#34901)

* code and test

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2024-04-21 19:56:14 -07:00 коммит произвёл GitHub
Родитель 47fb430b38
Коммит 38be2cf836
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
88 изменённых файлов: 1469 добавлений и 2627 удалений

Просмотреть файл

@ -1,5 +1,13 @@
# Release History
## 2.1.0 (2024-04-22)
### Features Added
- Model DicomService has a new parameter enable_data_partitions
- Model DicomService has a new parameter storage_configuration
- Model FhirServiceAuthenticationConfiguration has a new parameter smart_identity_providers
## 2.0.0 (2023-12-18)
### Features Added

Просмотреть файл

@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python
This is the Microsoft Azure Health Care Apis Management Client Library.
This package has been tested with Python 3.7+.
This package has been tested with Python 3.8+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
## _Disclaimer_
@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
### Prerequisites
- Python 3.7+ is required to use this package.
- Python 3.8+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)
### Install the package

Просмотреть файл

@ -1,11 +1,11 @@
{
"commit": "583e15ceb4cf23dc23b2300bd352f16d781e69ac",
"commit": "0e1d8ac4d5ca8a76479870db0a04aebe4fc3eab0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
"@autorest/python@6.13.7",
"@autorest/modelerfour@4.27.0"
],
"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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --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=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
"readme": "specification/healthcareapis/resource-manager/readme.md"
}

Просмотреть файл

@ -8,7 +8,6 @@
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
@ -19,7 +18,7 @@ if TYPE_CHECKING:
from azure.core.credentials import TokenCredential
class HealthcareApisManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class HealthcareApisManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for HealthcareApisManagementClient.
Note that all parameters used to create this instance are saved as instance
@ -29,14 +28,13 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-03-31". 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: str = kwargs.pop("api_version", "2023-11-01")
api_version: str = kwargs.pop("api_version", "2024-03-31")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -48,6 +46,7 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-healthcareapis/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
@ -56,9 +55,9 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(

Просмотреть файл

@ -9,8 +9,10 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from . import models as _models
from ._configuration import HealthcareApisManagementClientConfiguration
@ -77,7 +79,7 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
: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 "2023-11-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-03-31". 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 +96,25 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
self._config = HealthcareApisManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
@ -128,7 +148,7 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
self._client, self._config, self._serialize, self._deserialize
)
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -148,7 +168,7 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()

Просмотреть файл

@ -63,8 +63,8 @@ import xml.etree.ElementTree as ET
import isodate # type: ignore
from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback
from azure.core.serialization import NULL as AzureCoreNull
from azure.core.exceptions import DeserializationError, SerializationError
from azure.core.serialization import NULL as CoreNull
_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")
@ -124,7 +124,7 @@ class RawDeserializer:
pass
return ET.fromstring(data_as_str) # nosec
except ET.ParseError:
except ET.ParseError as err:
# It might be because the server has an issue, and returned JSON with
# content-type XML....
# So let's try a JSON load, and if it's still broken
@ -143,7 +143,7 @@ class RawDeserializer:
# The function hack is because Py2.7 messes up with exception
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise_with_traceback(DeserializationError, "XML is invalid")
raise DeserializationError("XML is invalid") from err
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
@classmethod
@ -170,13 +170,6 @@ class RawDeserializer:
return None
try:
basestring # type: ignore
unicode_str = unicode # type: ignore
except NameError:
basestring = str
unicode_str = str
_LOGGER = logging.getLogger(__name__)
try:
@ -295,7 +288,7 @@ class Model(object):
_validation: Dict[str, Dict[str, Any]] = {}
def __init__(self, **kwargs: Any) -> None:
self.additional_properties: Dict[str, Any] = {}
self.additional_properties: Optional[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__)
@ -340,7 +333,7 @@ class Model(object):
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: bool = False, **kwargs: Any) -> JSON:
"""Return the JSON that would be sent to azure from this model.
"""Return the JSON that would be sent to server from this model.
This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`.
@ -351,7 +344,7 @@ class Model(object):
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs)
return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
def as_dict(
self,
@ -390,7 +383,7 @@ class Model(object):
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs)
return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
@classmethod
def _infer_class_models(cls):
@ -415,7 +408,7 @@ class Model(object):
:raises: DeserializationError if something went wrong
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type)
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@classmethod
def from_dict(
@ -445,7 +438,7 @@ class Model(object):
if key_extractors is None
else key_extractors
)
return deserializer(cls.__name__, data, content_type=content_type)
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@classmethod
def _flatten_subtype(cls, key, objects):
@ -545,7 +538,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None):
def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@ -561,7 +554,7 @@ class Serializer(object):
"[]": self.serialize_iter,
"{}": self.serialize_dict,
}
self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {}
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
@ -649,7 +642,7 @@ class Serializer(object):
else: # That's a basic type
# Integrate namespace if necessary
local_node = _create_xml_node(xml_name, xml_prefix, xml_ns)
local_node.text = unicode_str(new_attr)
local_node.text = str(new_attr)
serialized.append(local_node) # type: ignore
else: # JSON
for k in reversed(keys): # type: ignore
@ -668,7 +661,7 @@ class Serializer(object):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise_with_traceback(SerializationError, msg, err)
raise SerializationError(msg) from err
else:
return serialized
@ -710,7 +703,7 @@ class Serializer(object):
]
data = deserializer._deserialize(data_type, data)
except DeserializationError as err:
raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err)
raise SerializationError("Unable to build a model: " + str(err)) from err
return self._serialize(data, data_type, **kwargs)
@ -730,6 +723,7 @@ class Serializer(object):
if kwargs.get("skip_quote") is True:
output = str(output)
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
except SerializationError:
@ -744,7 +738,7 @@ class Serializer(object):
: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
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@ -753,7 +747,7 @@ class Serializer(object):
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
do_quote = not kwargs.get("skip_quote", False)
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
return 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)
@ -804,7 +798,7 @@ class Serializer(object):
raise ValueError("No value for given attribute")
try:
if data is AzureCoreNull:
if data is CoreNull:
return None
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
@ -824,7 +818,7 @@ class Serializer(object):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
raise_with_traceback(SerializationError, msg.format(data, data_type), err)
raise SerializationError(msg.format(data, data_type)) from err
else:
return self._serialize(data, **kwargs)
@ -993,7 +987,7 @@ class Serializer(object):
return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs)
if obj_type is _long_type:
return self.serialize_long(attr)
if obj_type is unicode_str:
if obj_type is str:
return self.serialize_unicode(attr)
if obj_type is datetime.datetime:
return self.serialize_iso(attr)
@ -1170,10 +1164,10 @@ class Serializer(object):
return date + microseconds + "Z"
except (ValueError, OverflowError) as err:
msg = "Unable to serialize datetime object."
raise_with_traceback(SerializationError, msg, err)
raise SerializationError(msg) from err
except AttributeError as err:
msg = "ISO-8601 object must be valid Datetime object."
raise_with_traceback(TypeError, msg, err)
raise TypeError(msg) from err
@staticmethod
def serialize_unix(attr, **kwargs):
@ -1209,7 +1203,6 @@ def rest_key_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
# https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])
@ -1230,7 +1223,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
# https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])
@ -1371,7 +1363,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: Optional[Mapping[str, Type[ModelType]]] = None):
def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@ -1391,7 +1383,7 @@ class Deserializer(object):
"duration": (isodate.Duration, datetime.timedelta),
"iso-8601": (datetime.datetime),
}
self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {}
self.dependencies: Dict[str, type] = 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
@ -1444,7 +1436,7 @@ class Deserializer(object):
response, class_name = self._classify_target(target_obj, data)
if isinstance(response, basestring):
if isinstance(response, str):
return self.deserialize_data(data, response)
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
@ -1481,7 +1473,7 @@ class Deserializer(object):
d_attrs[attr] = value
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
additional_properties = self._build_additional_properties(attributes, data)
return self._instantiate_model(response, d_attrs, additional_properties)
@ -1515,14 +1507,14 @@ class Deserializer(object):
if target is None:
return None, None
if isinstance(target, basestring):
if isinstance(target, str):
try:
target = self.dependencies[target]
except KeyError:
return target, target
try:
target = target._classify(data, self.dependencies)
target = target._classify(data, self.dependencies) # type: ignore
except AttributeError:
pass # Target is not a Model, no classify
return target, target.__class__.__name__ # type: ignore
@ -1578,7 +1570,7 @@ class Deserializer(object):
if hasattr(raw_data, "_content_consumed"):
return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers)
if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"):
if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"):
return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore
return raw_data
@ -1652,7 +1644,7 @@ class Deserializer(object):
except (ValueError, TypeError, AttributeError) as err:
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
return self._deserialize(obj_type, data)
@ -1700,7 +1692,7 @@ class Deserializer(object):
if isinstance(attr, ET.Element):
# Do no recurse on XML, just return the tree as-is
return attr
if isinstance(attr, basestring):
if isinstance(attr, str):
return self.deserialize_basic(attr, "str")
obj_type = type(attr)
if obj_type in self.basic_types:
@ -1757,7 +1749,7 @@ class Deserializer(object):
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
elif isinstance(attr, basestring):
elif isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
elif attr.lower() in ["false", "0"]:
@ -1808,7 +1800,6 @@ class Deserializer(object):
data = data.value
if isinstance(data, int):
# Workaround. We might consider remove it in the future.
# https://github.com/Azure/azure-rest-api-specs/issues/141
try:
return list(enum_obj.__members__.values())[data]
except IndexError:
@ -1862,10 +1853,10 @@ class Deserializer(object):
if isinstance(attr, ET.Element):
attr = attr.text
try:
return decimal.Decimal(attr) # type: ignore
return decimal.Decimal(str(attr)) # type: ignore
except decimal.DecimalException as err:
msg = "Invalid decimal {}".format(attr)
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
@staticmethod
def deserialize_long(attr):
@ -1893,7 +1884,7 @@ class Deserializer(object):
duration = isodate.parse_duration(attr)
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
return duration
@ -1910,7 +1901,7 @@ class Deserializer(object):
if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore
raise DeserializationError("Date must have only digits and -. Received: %s" % attr)
# This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception.
return isodate.parse_date(attr, defaultmonth=None, defaultday=None)
return isodate.parse_date(attr, defaultmonth=0, defaultday=0)
@staticmethod
def deserialize_time(attr):
@ -1945,7 +1936,7 @@ class Deserializer(object):
date_obj = date_obj.astimezone(tz=TZ_UTC)
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
return date_obj
@ -1982,7 +1973,7 @@ class Deserializer(object):
raise OverflowError("Hit max or min date")
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
return date_obj
@ -1998,9 +1989,10 @@ class Deserializer(object):
if isinstance(attr, ET.Element):
attr = int(attr.text) # type: ignore
try:
attr = int(attr)
date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC)
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
raise_with_traceback(DeserializationError, msg, err)
raise DeserializationError(msg) from err
else:
return date_obj

Просмотреть файл

@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "2.0.0"
VERSION = "2.1.0"

Просмотреть файл

@ -8,7 +8,6 @@
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
@ -19,7 +18,7 @@ if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
class HealthcareApisManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class HealthcareApisManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for HealthcareApisManagementClient.
Note that all parameters used to create this instance are saved as instance
@ -29,14 +28,13 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-03-31". 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: str = kwargs.pop("api_version", "2023-11-01")
api_version: str = kwargs.pop("api_version", "2024-03-31")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -48,6 +46,7 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-healthcareapis/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
@ -56,9 +55,9 @@ class HealthcareApisManagementClientConfiguration(Configuration): # pylint: dis
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(

Просмотреть файл

@ -9,8 +9,10 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .. import models as _models
from .._serialization import Deserializer, Serializer
@ -77,7 +79,7 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
: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 "2023-11-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-03-31". 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 +96,25 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
self._config = HealthcareApisManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
AsyncARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
@ -128,7 +148,9 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
self._client, self._config, self._serialize, self._deserialize
)
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -148,7 +170,7 @@ class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-vers
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -73,7 +73,6 @@ class DicomServicesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DicomService or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.DicomService]
:raises ~azure.core.exceptions.HttpResponseError:
@ -95,17 +94,16 @@ class DicomServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -117,13 +115,13 @@ class DicomServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("DicomServiceCollection", pipeline_response)
@ -133,11 +131,11 @@ class DicomServicesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -150,10 +148,6 @@ class DicomServicesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, dicom_service_name: str, **kwargs: Any
@ -167,7 +161,6 @@ class DicomServicesOperations:
:type workspace_name: str
:param dicom_service_name: The name of DICOM Service resource. Required.
:type dicom_service_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DicomService or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.DicomService
:raises ~azure.core.exceptions.HttpResponseError:
@ -186,22 +179,21 @@ class DicomServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
dicom_service_name=dicom_service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -214,20 +206,16 @@ class DicomServicesOperations:
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: Union[_models.DicomService, IO],
dicomservice: Union[_models.DicomService, IO[bytes]],
**kwargs: Any
) -> _models.DicomService:
error_map = {
@ -253,7 +241,7 @@ class DicomServicesOperations:
else:
_json = self._serialize.body(dicomservice, "DicomService")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
dicom_service_name=dicom_service_name,
@ -262,16 +250,15 @@ class DicomServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -295,10 +282,6 @@ class DicomServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
@overload
async def begin_create_or_update(
self,
@ -325,14 +308,6 @@ class DicomServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -345,7 +320,7 @@ class DicomServicesOperations:
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: IO,
dicomservice: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -361,18 +336,10 @@ class DicomServicesOperations:
:type dicom_service_name: str
:param dicomservice: The parameters for creating or updating a Dicom Service resource.
Required.
:type dicomservice: IO
:type dicomservice: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -385,7 +352,7 @@ class DicomServicesOperations:
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: Union[_models.DicomService, IO],
dicomservice: Union[_models.DicomService, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DicomService]:
"""Creates or updates a DICOM Service resource with the specified parameters.
@ -398,19 +365,8 @@ class DicomServicesOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
either a DicomService type or a IO[bytes] type. Required.
:type dicomservice: ~azure.mgmt.healthcareapis.models.DicomService or IO[bytes]
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -443,7 +399,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -453,24 +409,22 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.DicomService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return AsyncLROPoller[_models.DicomService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_initial(
self,
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO],
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.DicomService:
error_map = {
@ -496,7 +450,7 @@ class DicomServicesOperations:
else:
_json = self._serialize.body(dicomservice_patch_resource, "DicomServicePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
dicom_service_name=dicom_service_name,
workspace_name=workspace_name,
@ -505,16 +459,15 @@ class DicomServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -535,10 +488,6 @@ class DicomServicesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
@overload
async def begin_update(
self,
@ -564,14 +513,6 @@ class DicomServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -584,7 +525,7 @@ class DicomServicesOperations:
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: IO,
dicomservice_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -599,18 +540,10 @@ class DicomServicesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param dicomservice_patch_resource: The parameters for updating a Dicom Service. Required.
:type dicomservice_patch_resource: IO
:type dicomservice_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -623,7 +556,7 @@ class DicomServicesOperations:
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO],
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DicomService]:
"""Patch DICOM Service details.
@ -636,20 +569,9 @@ class DicomServicesOperations:
: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
DicomServicePatchResource type or a IO type. Required.
DicomServicePatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -682,7 +604,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -692,17 +614,15 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.DicomService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return AsyncLROPoller[_models.DicomService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, dicom_service_name: str, workspace_name: str, **kwargs: Any
@ -721,22 +641,21 @@ class DicomServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
dicom_service_name=dicom_service_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -747,11 +666,7 @@ class DicomServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -766,14 +681,6 @@ class DicomServicesOperations:
:type dicom_service_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -801,7 +708,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -810,14 +717,10 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -65,7 +65,6 @@ class FhirDestinationsOperations:
:type workspace_name: str
:param iot_connector_name: The name of IoT Connector resource. Required.
:type iot_connector_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IotFhirDestination or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.IotFhirDestination]
@ -88,18 +87,17 @@ class FhirDestinationsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_iot_connector_request(
_request = build_list_by_iot_connector_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_iot_connector.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -111,13 +109,13 @@ class FhirDestinationsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("IotFhirDestinationCollection", pipeline_response)
@ -127,11 +125,11 @@ class FhirDestinationsOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -143,7 +141,3 @@ class FhirDestinationsOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
list_by_iot_connector.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations"
}

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -73,7 +73,6 @@ class FhirServicesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either FhirService or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.FhirService]
:raises ~azure.core.exceptions.HttpResponseError:
@ -95,17 +94,16 @@ class FhirServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -117,13 +115,13 @@ class FhirServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("FhirServiceCollection", pipeline_response)
@ -133,11 +131,11 @@ class FhirServicesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -150,10 +148,6 @@ class FhirServicesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, fhir_service_name: str, **kwargs: Any
@ -167,7 +161,6 @@ class FhirServicesOperations:
:type workspace_name: str
:param fhir_service_name: The name of FHIR Service resource. Required.
:type fhir_service_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: FhirService or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.FhirService
:raises ~azure.core.exceptions.HttpResponseError:
@ -186,22 +179,21 @@ class FhirServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
fhir_service_name=fhir_service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -214,20 +206,16 @@ class FhirServicesOperations:
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: Union[_models.FhirService, IO],
fhirservice: Union[_models.FhirService, IO[bytes]],
**kwargs: Any
) -> _models.FhirService:
error_map = {
@ -253,7 +241,7 @@ class FhirServicesOperations:
else:
_json = self._serialize.body(fhirservice, "FhirService")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
fhir_service_name=fhir_service_name,
@ -262,16 +250,15 @@ class FhirServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -295,10 +282,6 @@ class FhirServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
@overload
async def begin_create_or_update(
self,
@ -324,14 +307,6 @@ class FhirServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -344,7 +319,7 @@ class FhirServicesOperations:
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: IO,
fhirservice: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -359,18 +334,10 @@ class FhirServicesOperations:
: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. Required.
:type fhirservice: IO
:type fhirservice: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -383,7 +350,7 @@ class FhirServicesOperations:
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: Union[_models.FhirService, IO],
fhirservice: Union[_models.FhirService, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.FhirService]:
"""Creates or updates a FHIR Service resource with the specified parameters.
@ -396,19 +363,8 @@ class FhirServicesOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
a FhirService type or a IO[bytes] type. Required.
:type fhirservice: ~azure.mgmt.healthcareapis.models.FhirService or IO[bytes]
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -441,7 +397,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -451,24 +407,22 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.FhirService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return AsyncLROPoller[_models.FhirService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_initial(
self,
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO],
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.FhirService:
error_map = {
@ -494,7 +448,7 @@ class FhirServicesOperations:
else:
_json = self._serialize.body(fhirservice_patch_resource, "FhirServicePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
fhir_service_name=fhir_service_name,
workspace_name=workspace_name,
@ -503,16 +457,15 @@ class FhirServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -533,10 +486,6 @@ class FhirServicesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
@overload
async def begin_update(
self,
@ -562,14 +511,6 @@ class FhirServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -582,7 +523,7 @@ class FhirServicesOperations:
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: IO,
fhirservice_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -597,18 +538,10 @@ class FhirServicesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param fhirservice_patch_resource: The parameters for updating a Fhir Service. Required.
:type fhirservice_patch_resource: IO
:type fhirservice_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -621,7 +554,7 @@ class FhirServicesOperations:
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO],
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.FhirService]:
"""Patch FHIR Service details.
@ -634,20 +567,9 @@ class FhirServicesOperations:
: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
FhirServicePatchResource type or a IO type. Required.
FhirServicePatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
IO[bytes]
:return: An instance of AsyncLROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -680,7 +602,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -690,17 +612,15 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.FhirService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return AsyncLROPoller[_models.FhirService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, fhir_service_name: str, workspace_name: str, **kwargs: Any
@ -719,22 +639,21 @@ class FhirServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
fhir_service_name=fhir_service_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -745,11 +664,7 @@ class FhirServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -764,14 +679,6 @@ class FhirServicesOperations:
:type fhir_service_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -799,7 +706,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -808,14 +715,10 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -77,7 +77,6 @@ class IotConnectorFhirDestinationOperations:
:type iot_connector_name: str
:param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required.
:type fhir_destination_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IotFhirDestination or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.IotFhirDestination
:raises ~azure.core.exceptions.HttpResponseError:
@ -96,23 +95,22 @@ class IotConnectorFhirDestinationOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
fhir_destination_name=fhir_destination_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -125,13 +123,9 @@ class IotConnectorFhirDestinationOperations:
deserialized = self._deserialize("IotFhirDestination", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
@ -139,7 +133,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: Union[_models.IotFhirDestination, IO],
iot_fhir_destination: Union[_models.IotFhirDestination, IO[bytes]],
**kwargs: Any
) -> _models.IotFhirDestination:
error_map = {
@ -165,7 +159,7 @@ class IotConnectorFhirDestinationOperations:
else:
_json = self._serialize.body(iot_fhir_destination, "IotFhirDestination")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
@ -175,16 +169,15 @@ class IotConnectorFhirDestinationOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -208,10 +201,6 @@ class IotConnectorFhirDestinationOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
@overload
async def begin_create_or_update(
self,
@ -241,14 +230,6 @@ class IotConnectorFhirDestinationOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype:
@ -263,7 +244,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: IO,
iot_fhir_destination: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -281,18 +262,10 @@ class IotConnectorFhirDestinationOperations:
:type fhir_destination_name: str
:param iot_fhir_destination: The parameters for creating or updating an IoT Connector FHIR
destination resource. Required.
:type iot_fhir_destination: IO
:type iot_fhir_destination: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype:
@ -307,7 +280,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: Union[_models.IotFhirDestination, IO],
iot_fhir_destination: Union[_models.IotFhirDestination, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.IotFhirDestination]:
"""Creates or updates an IoT Connector FHIR destination resource with the specified parameters.
@ -322,19 +295,8 @@ class IotConnectorFhirDestinationOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
destination resource. Is either a IotFhirDestination type or a IO[bytes] type. Required.
:type iot_fhir_destination: ~azure.mgmt.healthcareapis.models.IotFhirDestination or IO[bytes]
:return: An instance of AsyncLROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype:
@ -369,7 +331,7 @@ class IotConnectorFhirDestinationOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotFhirDestination", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -379,17 +341,15 @@ class IotConnectorFhirDestinationOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.IotFhirDestination].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return AsyncLROPoller[_models.IotFhirDestination](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
@ -413,23 +373,22 @@ class IotConnectorFhirDestinationOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
fhir_destination_name=fhir_destination_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -440,11 +399,7 @@ class IotConnectorFhirDestinationOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -466,14 +421,6 @@ class IotConnectorFhirDestinationOperations:
:type iot_connector_name: str
:param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required.
:type fhir_destination_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -502,7 +449,7 @@ class IotConnectorFhirDestinationOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -511,14 +458,10 @@ class IotConnectorFhirDestinationOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -73,7 +73,6 @@ class IotConnectorsOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IotConnector or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.IotConnector]
:raises ~azure.core.exceptions.HttpResponseError:
@ -95,17 +94,16 @@ class IotConnectorsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -117,13 +115,13 @@ class IotConnectorsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("IotConnectorCollection", pipeline_response)
@ -133,11 +131,11 @@ class IotConnectorsOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -150,10 +148,6 @@ class IotConnectorsOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, iot_connector_name: str, **kwargs: Any
@ -167,7 +161,6 @@ class IotConnectorsOperations:
:type workspace_name: str
:param iot_connector_name: The name of IoT Connector resource. Required.
:type iot_connector_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IotConnector or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.IotConnector
:raises ~azure.core.exceptions.HttpResponseError:
@ -186,22 +179,21 @@ class IotConnectorsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -214,20 +206,16 @@ class IotConnectorsOperations:
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: Union[_models.IotConnector, IO],
iot_connector: Union[_models.IotConnector, IO[bytes]],
**kwargs: Any
) -> _models.IotConnector:
error_map = {
@ -253,7 +241,7 @@ class IotConnectorsOperations:
else:
_json = self._serialize.body(iot_connector, "IotConnector")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
@ -262,16 +250,15 @@ class IotConnectorsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -295,10 +282,6 @@ class IotConnectorsOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
@overload
async def begin_create_or_update(
self,
@ -325,14 +308,6 @@ class IotConnectorsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -345,7 +320,7 @@ class IotConnectorsOperations:
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: IO,
iot_connector: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -361,18 +336,10 @@ class IotConnectorsOperations:
:type iot_connector_name: str
:param iot_connector: The parameters for creating or updating an IoT Connectors resource.
Required.
:type iot_connector: IO
:type iot_connector: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -385,7 +352,7 @@ class IotConnectorsOperations:
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: Union[_models.IotConnector, IO],
iot_connector: Union[_models.IotConnector, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.IotConnector]:
"""Creates or updates an IoT Connector resource with the specified parameters.
@ -398,19 +365,8 @@ class IotConnectorsOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
either a IotConnector type or a IO[bytes] type. Required.
:type iot_connector: ~azure.mgmt.healthcareapis.models.IotConnector or IO[bytes]
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -443,7 +399,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -453,24 +409,22 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.IotConnector].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return AsyncLROPoller[_models.IotConnector](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_initial(
self,
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO],
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO[bytes]],
**kwargs: Any
) -> _models.IotConnector:
error_map = {
@ -496,7 +450,7 @@ class IotConnectorsOperations:
else:
_json = self._serialize.body(iot_connector_patch_resource, "IotConnectorPatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
iot_connector_name=iot_connector_name,
workspace_name=workspace_name,
@ -505,16 +459,15 @@ class IotConnectorsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -535,10 +488,6 @@ class IotConnectorsOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
@overload
async def begin_update(
self,
@ -564,14 +513,6 @@ class IotConnectorsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -584,7 +525,7 @@ class IotConnectorsOperations:
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: IO,
iot_connector_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -599,18 +540,10 @@ class IotConnectorsOperations:
: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. Required.
:type iot_connector_patch_resource: IO
:type iot_connector_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -623,7 +556,7 @@ class IotConnectorsOperations:
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO],
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.IotConnector]:
"""Patch an IoT Connector.
@ -636,20 +569,9 @@ class IotConnectorsOperations:
: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
IotConnectorPatchResource type or a IO type. Required.
IotConnectorPatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -682,7 +604,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -692,17 +614,15 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.IotConnector].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return AsyncLROPoller[_models.IotConnector](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, iot_connector_name: str, workspace_name: str, **kwargs: Any
@ -721,22 +641,21 @@ class IotConnectorsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
iot_connector_name=iot_connector_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -747,11 +666,7 @@ class IotConnectorsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -766,14 +681,6 @@ class IotConnectorsOperations:
:type iot_connector_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -801,7 +708,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -810,14 +717,10 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -60,7 +60,6 @@ class OperationResultsOperations:
:type location_name: str
:param operation_result_id: The ID of the operation result to get. Required.
:type operation_result_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: OperationResultsDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.OperationResultsDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -79,21 +78,20 @@ class OperationResultsOperations:
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(
_request = build_get_request(
location_name=location_name,
operation_result_id=operation_result_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -106,10 +104,6 @@ class OperationResultsOperations:
deserialized = self._deserialize("OperationResultsDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -56,7 +56,6 @@ class Operations:
def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]:
"""Lists all of the available operations supported by Microsoft Healthcare resource provider.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationDetail or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.OperationDetail]
@ -79,14 +78,13 @@ class Operations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
_request = build_list_request(
api_version=api_version,
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -98,13 +96,13 @@ class Operations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ListOperations", pipeline_response)
@ -114,11 +112,11 @@ class Operations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -130,5 +128,3 @@ class Operations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
list.metadata = {"url": "/providers/Microsoft.HealthcareApis/operations"}

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -72,7 +72,6 @@ class PrivateEndpointConnectionsOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateEndpointConnectionDescription or the result
of cls(response)
:rtype:
@ -96,17 +95,16 @@ class PrivateEndpointConnectionsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_service_request(
_request = build_list_by_service_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_service.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -118,13 +116,13 @@ class PrivateEndpointConnectionsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionListResultDescription", pipeline_response)
@ -134,11 +132,11 @@ class PrivateEndpointConnectionsOperations:
return None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -151,10 +149,6 @@ class PrivateEndpointConnectionsOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_service.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -169,7 +163,6 @@ class PrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateEndpointConnectionDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -188,22 +181,21 @@ class PrivateEndpointConnectionsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -216,20 +208,16 @@ class PrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnection, IO],
properties: Union[_models.PrivateEndpointConnection, IO[bytes]],
**kwargs: Any
) -> _models.PrivateEndpointConnectionDescription:
error_map = {
@ -255,7 +243,7 @@ class PrivateEndpointConnectionsOperations:
else:
_json = self._serialize.body(properties, "PrivateEndpointConnection")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@ -264,16 +252,15 @@ class PrivateEndpointConnectionsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -286,13 +273,9 @@ class PrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
@overload
async def begin_create_or_update(
@ -320,14 +303,6 @@ class PrivateEndpointConnectionsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -341,7 +316,7 @@ class PrivateEndpointConnectionsOperations:
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: IO,
properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -357,18 +332,10 @@ class PrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param properties: The private endpoint connection properties. Required.
:type properties: IO
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -382,7 +349,7 @@ class PrivateEndpointConnectionsOperations:
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnection, IO],
properties: Union[_models.PrivateEndpointConnection, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.PrivateEndpointConnectionDescription]:
"""Update the state of the specified private endpoint connection associated with the service.
@ -396,19 +363,8 @@ class PrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
PrivateEndpointConnection type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnection or IO[bytes]
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -442,7 +398,7 @@ class PrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -452,17 +408,15 @@ class PrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.PrivateEndpointConnectionDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return AsyncLROPoller[_models.PrivateEndpointConnectionDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -481,22 +435,21 @@ class PrivateEndpointConnectionsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -507,11 +460,7 @@ class PrivateEndpointConnectionsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -527,14 +476,6 @@ class PrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -562,7 +503,7 @@ class PrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -571,14 +512,10 @@ class PrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -61,7 +61,6 @@ class PrivateLinkResourcesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceListResultDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceListResultDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -80,21 +79,20 @@ class PrivateLinkResourcesOperations:
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(
_request = build_list_by_service_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_service.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -107,13 +105,9 @@ class PrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceListResultDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
list_by_service.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources"
}
return deserialized # type: ignore
@distributed_trace_async
async def get(
@ -128,7 +122,6 @@ class PrivateLinkResourcesOperations:
:type resource_name: str
:param group_name: The name of the private link resource group. Required.
:type group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -147,22 +140,21 @@ class PrivateLinkResourcesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
group_name=group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -175,10 +167,6 @@ class PrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -73,7 +73,6 @@ class ServicesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -92,21 +91,20 @@ class ServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -119,19 +117,15 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
service_description: Union[_models.ServicesDescription, IO],
service_description: Union[_models.ServicesDescription, IO[bytes]],
**kwargs: Any
) -> _models.ServicesDescription:
error_map = {
@ -157,7 +151,7 @@ class ServicesOperations:
else:
_json = self._serialize.body(service_description, "ServicesDescription")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
@ -165,16 +159,15 @@ class ServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -195,10 +188,6 @@ class ServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
@overload
async def begin_create_or_update(
self,
@ -221,14 +210,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -241,7 +222,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_description: IO,
service_description: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -254,18 +235,10 @@ class ServicesOperations:
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:param service_description: The service instance metadata. Required.
:type service_description: IO
:type service_description: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -278,7 +251,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_description: Union[_models.ServicesDescription, IO],
service_description: Union[_models.ServicesDescription, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ServicesDescription]:
"""Create or update the metadata of a service instance.
@ -289,19 +262,8 @@ class ServicesOperations:
:param resource_name: The name of the service instance. Required.
:type resource_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or a IO[bytes] type. Required.
:type service_description: ~azure.mgmt.healthcareapis.models.ServicesDescription or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -334,7 +296,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -344,23 +306,21 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.ServicesDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return AsyncLROPoller[_models.ServicesDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_initial(
self,
resource_group_name: str,
resource_name: str,
service_patch_description: Union[_models.ServicesPatchDescription, IO],
service_patch_description: Union[_models.ServicesPatchDescription, IO[bytes]],
**kwargs: Any
) -> _models.ServicesDescription:
error_map = {
@ -386,7 +346,7 @@ class ServicesOperations:
else:
_json = self._serialize.body(service_patch_description, "ServicesPatchDescription")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
@ -394,16 +354,15 @@ class ServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -416,13 +375,9 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return deserialized # type: ignore
@overload
async def begin_update(
@ -447,14 +402,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -467,7 +414,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_patch_description: IO,
service_patch_description: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -481,18 +428,10 @@ class ServicesOperations:
:type resource_name: str
:param service_patch_description: The service instance metadata and security metadata.
Required.
:type service_patch_description: IO
:type service_patch_description: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -505,7 +444,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_patch_description: Union[_models.ServicesPatchDescription, IO],
service_patch_description: Union[_models.ServicesPatchDescription, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ServicesDescription]:
"""Update the metadata of a service instance.
@ -516,20 +455,9 @@ class ServicesOperations:
: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 ServicesPatchDescription type or a IO type. Required.
either a ServicesPatchDescription type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype:
@ -562,7 +490,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -572,17 +500,15 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.ServicesDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return AsyncLROPoller[_models.ServicesDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, resource_name: str, **kwargs: Any
@ -601,21 +527,20 @@ class ServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -626,11 +551,7 @@ class ServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
@ -641,14 +562,6 @@ class ServicesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -675,7 +588,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -684,23 +597,18 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.ServicesDescription"]:
"""Get all the service instances in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ServicesDescription or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -723,15 +631,14 @@ class ServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -743,13 +650,13 @@ class ServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ServicesDescriptionListResult", pipeline_response)
@ -759,11 +666,11 @@ class ServicesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -776,8 +683,6 @@ class ServicesOperations:
return AsyncItemPaged(get_next, extract_data)
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services"}
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
@ -787,7 +692,6 @@ class ServicesOperations:
:param resource_group_name: The name of the resource group that contains the service instance.
Required.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ServicesDescription or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -810,16 +714,15 @@ class ServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_resource_group_request(
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_resource_group.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -831,13 +734,13 @@ class ServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ServicesDescriptionListResult", pipeline_response)
@ -847,11 +750,11 @@ class ServicesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -864,10 +767,6 @@ class ServicesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_resource_group.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services"
}
@overload
async def check_name_availability(
self,
@ -886,7 +785,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -894,18 +792,17 @@ class ServicesOperations:
@overload
async def check_name_availability(
self, check_name_availability_inputs: IO, *, content_type: str = "application/json", **kwargs: Any
self, check_name_availability_inputs: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ServicesNameAvailabilityInfo:
"""Check if a service instance name is available.
:param check_name_availability_inputs: Set the name parameter in the
CheckNameAvailabilityParameters structure to the name of the service instance to check.
Required.
:type check_name_availability_inputs: IO
:type check_name_availability_inputs: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -913,19 +810,15 @@ class ServicesOperations:
@distributed_trace_async
async def check_name_availability(
self, check_name_availability_inputs: Union[_models.CheckNameAvailabilityParameters, IO], **kwargs: Any
self, check_name_availability_inputs: Union[_models.CheckNameAvailabilityParameters, IO[bytes]], **kwargs: Any
) -> _models.ServicesNameAvailabilityInfo:
"""Check if a service instance name is available.
: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 CheckNameAvailabilityParameters type or a IO type. Required.
either a CheckNameAvailabilityParameters type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
~azure.mgmt.healthcareapis.models.CheckNameAvailabilityParameters or IO[bytes]
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -953,22 +846,21 @@ class ServicesOperations:
else:
_json = self._serialize.body(check_name_availability_inputs, "CheckNameAvailabilityParameters")
request = build_check_name_availability_request(
_request = build_check_name_availability_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
template_url=self.check_name_availability.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -981,10 +873,6 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesNameAvailabilityInfo", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
check_name_availability.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -42,7 +42,7 @@ T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class WorkspacePrivateEndpointConnectionsOperations:
class WorkspacePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@ -72,7 +72,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateEndpointConnectionDescription or the result
of cls(response)
:rtype:
@ -96,17 +95,16 @@ class WorkspacePrivateEndpointConnectionsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -118,13 +116,13 @@ class WorkspacePrivateEndpointConnectionsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionListResultDescription", pipeline_response)
@ -134,11 +132,11 @@ class WorkspacePrivateEndpointConnectionsOperations:
return None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -151,10 +149,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -169,7 +163,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateEndpointConnectionDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -188,22 +181,21 @@ class WorkspacePrivateEndpointConnectionsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -216,20 +208,16 @@ class WorkspacePrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnectionDescription, IO],
properties: Union[_models.PrivateEndpointConnectionDescription, IO[bytes]],
**kwargs: Any
) -> _models.PrivateEndpointConnectionDescription:
error_map = {
@ -255,7 +243,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
_json = self._serialize.body(properties, "PrivateEndpointConnectionDescription")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@ -264,16 +252,15 @@ class WorkspacePrivateEndpointConnectionsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -286,13 +273,9 @@ class WorkspacePrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
@overload
async def begin_create_or_update(
@ -320,14 +303,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -341,7 +316,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: IO,
properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -357,18 +332,10 @@ class WorkspacePrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param properties: The private endpoint connection properties. Required.
:type properties: IO
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -382,7 +349,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnectionDescription, IO],
properties: Union[_models.PrivateEndpointConnectionDescription, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.PrivateEndpointConnectionDescription]:
"""Update the state of the specified private endpoint connection associated with the workspace.
@ -396,19 +363,9 @@ class WorkspacePrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
PrivateEndpointConnectionDescription type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionDescription
or the result of cls(response)
:rtype:
@ -442,7 +399,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -452,17 +409,15 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.PrivateEndpointConnectionDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return AsyncLROPoller[_models.PrivateEndpointConnectionDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -481,22 +436,21 @@ class WorkspacePrivateEndpointConnectionsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -507,11 +461,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
@ -527,14 +477,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -562,7 +504,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -571,14 +513,10 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -67,7 +67,6 @@ class WorkspacePrivateLinkResourcesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateLinkResourceDescription or the result of
cls(response)
:rtype:
@ -91,17 +90,16 @@ class WorkspacePrivateLinkResourcesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -113,13 +111,13 @@ class WorkspacePrivateLinkResourcesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateLinkResourceListResultDescription", pipeline_response)
@ -129,11 +127,11 @@ class WorkspacePrivateLinkResourcesOperations:
return None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -146,10 +144,6 @@ class WorkspacePrivateLinkResourcesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources"
}
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, group_name: str, **kwargs: Any
@ -163,7 +157,6 @@ class WorkspacePrivateLinkResourcesOperations:
:type workspace_name: str
:param group_name: The name of the private link resource group. Required.
:type group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -182,22 +175,21 @@ class WorkspacePrivateLinkResourcesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
group_name=group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -210,10 +202,6 @@ class WorkspacePrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -67,7 +67,6 @@ class WorkspacesOperations:
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Workspace"]:
"""Lists all the available workspaces under the specified subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Workspace or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -89,15 +88,14 @@ class WorkspacesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_subscription_request(
_request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_subscription.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -109,13 +107,13 @@ class WorkspacesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("WorkspaceList", pipeline_response)
@ -125,11 +123,11 @@ class WorkspacesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -142,10 +140,6 @@ class WorkspacesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_subscription.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces"
}
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Workspace"]:
"""Lists all the available workspaces under the specified resource group.
@ -153,7 +147,6 @@ class WorkspacesOperations:
:param resource_group_name: The name of the resource group that contains the service instance.
Required.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Workspace or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -175,16 +168,15 @@ class WorkspacesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_resource_group_request(
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_resource_group.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -196,13 +188,13 @@ class WorkspacesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("WorkspaceList", pipeline_response)
@ -212,11 +204,11 @@ class WorkspacesOperations:
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -229,10 +221,6 @@ class WorkspacesOperations:
return AsyncItemPaged(get_next, extract_data)
list_by_resource_group.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces"
}
@distributed_trace_async
async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace:
"""Gets the properties of the specified workspace.
@ -242,7 +230,6 @@ class WorkspacesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Workspace or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
@ -261,21 +248,20 @@ class WorkspacesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -288,16 +274,16 @@ class WorkspacesOperations:
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return deserialized # type: ignore
async def _create_or_update_initial(
self, resource_group_name: str, workspace_name: str, workspace: Union[_models.Workspace, IO], **kwargs: Any
self,
resource_group_name: str,
workspace_name: str,
workspace: Union[_models.Workspace, IO[bytes]],
**kwargs: Any
) -> _models.Workspace:
error_map = {
401: ClientAuthenticationError,
@ -322,7 +308,7 @@ class WorkspacesOperations:
else:
_json = self._serialize.body(workspace, "Workspace")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@ -330,16 +316,15 @@ class WorkspacesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -363,10 +348,6 @@ class WorkspacesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
@overload
async def begin_create_or_update(
self,
@ -389,14 +370,6 @@ class WorkspacesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -408,7 +381,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace: IO,
workspace: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -421,18 +394,10 @@ class WorkspacesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param workspace: The parameters for creating or updating a healthcare workspace. Required.
:type workspace: IO
:type workspace: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -441,7 +406,11 @@ class WorkspacesOperations:
@distributed_trace_async
async def begin_create_or_update(
self, resource_group_name: str, workspace_name: str, workspace: Union[_models.Workspace, IO], **kwargs: Any
self,
resource_group_name: str,
workspace_name: str,
workspace: Union[_models.Workspace, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.Workspace]:
"""Creates or updates a workspace resource with the specified parameters.
@ -451,19 +420,8 @@ class WorkspacesOperations:
: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
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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Workspace type or a IO[bytes] type. Required.
:type workspace: ~azure.mgmt.healthcareapis.models.Workspace or IO[bytes]
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -495,7 +453,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -505,23 +463,21 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.Workspace].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return AsyncLROPoller[_models.Workspace](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_initial(
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO],
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.Workspace:
error_map = {
@ -547,7 +503,7 @@ class WorkspacesOperations:
else:
_json = self._serialize.body(workspace_patch_resource, "WorkspacePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@ -555,16 +511,15 @@ class WorkspacesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -585,10 +540,6 @@ class WorkspacesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
@overload
async def begin_update(
self,
@ -611,14 +562,6 @@ class WorkspacesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -630,7 +573,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: IO,
workspace_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -643,18 +586,10 @@ class WorkspacesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param workspace_patch_resource: The parameters for updating a specified workspace. Required.
:type workspace_patch_resource: IO
:type workspace_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -666,7 +601,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO],
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.Workspace]:
"""Patch workspace details.
@ -677,19 +612,9 @@ class WorkspacesOperations:
: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
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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
WorkspacePatchResource type or a IO[bytes] type. Required.
:type workspace_patch_resource: ~azure.mgmt.healthcareapis.models.WorkspacePatchResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either Workspace or the result of
cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.healthcareapis.models.Workspace]
@ -721,7 +646,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -731,17 +656,15 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[_models.Workspace].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return AsyncLROPoller[_models.Workspace](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, **kwargs: Any
@ -760,21 +683,20 @@ class WorkspacesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -785,11 +707,7 @@ class WorkspacesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
@ -800,14 +718,6 @@ class WorkspacesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -834,7 +744,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
@ -843,14 +753,10 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -75,6 +75,9 @@ from ._models_py3 import ServicesPatchDescription
from ._models_py3 import ServicesProperties
from ._models_py3 import ServicesResource
from ._models_py3 import ServicesResourceIdentity
from ._models_py3 import SmartIdentityProviderApplication
from ._models_py3 import SmartIdentityProviderConfiguration
from ._models_py3 import StorageConfiguration
from ._models_py3 import SystemData
from ._models_py3 import TaggedResource
from ._models_py3 import UserAssignedIdentity
@ -98,6 +101,7 @@ from ._healthcare_apis_management_client_enums import PublicNetworkAccess
from ._healthcare_apis_management_client_enums import ServiceEventState
from ._healthcare_apis_management_client_enums import ServiceManagedIdentityType
from ._healthcare_apis_management_client_enums import ServiceNameUnavailabilityReason
from ._healthcare_apis_management_client_enums import SmartDataActions
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
@ -172,6 +176,9 @@ __all__ = [
"ServicesProperties",
"ServicesResource",
"ServicesResourceIdentity",
"SmartIdentityProviderApplication",
"SmartIdentityProviderConfiguration",
"StorageConfiguration",
"SystemData",
"TaggedResource",
"UserAssignedIdentity",
@ -194,6 +201,7 @@ __all__ = [
"ServiceEventState",
"ServiceManagedIdentityType",
"ServiceNameUnavailabilityReason",
"SmartDataActions",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -138,3 +138,9 @@ class ServiceNameUnavailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMe
INVALID = "Invalid"
ALREADY_EXISTS = "AlreadyExists"
class SmartDataActions(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The Data Actions that can be enabled for a Smart Identity Provider Application."""
READ = "Read"

Просмотреть файл

@ -27,7 +27,7 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
class CheckNameAvailabilityParameters(_serialization.Model):
"""Input values.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar name: The name of the service instance to check. Required.
:vartype name: str
@ -349,6 +349,10 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t
:vartype event_state: str or ~azure.mgmt.healthcareapis.models.ServiceEventState
:ivar encryption: The encryption settings of the DICOM service.
:vartype encryption: ~azure.mgmt.healthcareapis.models.Encryption
:ivar storage_configuration: The configuration of external storage account.
:vartype storage_configuration: ~azure.mgmt.healthcareapis.models.StorageConfiguration
:ivar enable_data_partitions: If data partitions is enabled or not.
:vartype enable_data_partitions: bool
"""
_validation = {
@ -385,6 +389,8 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t
"public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"},
"event_state": {"key": "properties.eventState", "type": "str"},
"encryption": {"key": "properties.encryption", "type": "Encryption"},
"storage_configuration": {"key": "properties.storageConfiguration", "type": "StorageConfiguration"},
"enable_data_partitions": {"key": "properties.enableDataPartitions", "type": "bool"},
}
def __init__(
@ -398,6 +404,8 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t
cors_configuration: Optional["_models.CorsConfiguration"] = None,
public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
encryption: Optional["_models.Encryption"] = None,
storage_configuration: Optional["_models.StorageConfiguration"] = None,
enable_data_partitions: Optional[bool] = None,
**kwargs: Any
) -> None:
"""
@ -421,6 +429,10 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t
:paramtype public_network_access: str or ~azure.mgmt.healthcareapis.models.PublicNetworkAccess
:keyword encryption: The encryption settings of the DICOM service.
:paramtype encryption: ~azure.mgmt.healthcareapis.models.Encryption
:keyword storage_configuration: The configuration of external storage account.
:paramtype storage_configuration: ~azure.mgmt.healthcareapis.models.StorageConfiguration
:keyword enable_data_partitions: If data partitions is enabled or not.
:paramtype enable_data_partitions: bool
"""
super().__init__(etag=etag, location=location, tags=tags, identity=identity, **kwargs)
self.identity = identity
@ -433,6 +445,8 @@ class DicomService(TaggedResource, ServiceManagedIdentity): # pylint: disable=t
self.public_network_access = public_network_access
self.event_state = None
self.encryption = encryption
self.storage_configuration = storage_configuration
self.enable_data_partitions = enable_data_partitions
self.id = None
self.name = None
self.type = None
@ -882,12 +896,17 @@ class FhirServiceAuthenticationConfiguration(_serialization.Model):
:vartype audience: str
:ivar smart_proxy_enabled: If the SMART on FHIR proxy is enabled.
:vartype smart_proxy_enabled: bool
:ivar smart_identity_providers: The array of identity provider configurations for SMART on FHIR
authentication.
:vartype smart_identity_providers:
list[~azure.mgmt.healthcareapis.models.SmartIdentityProviderConfiguration]
"""
_attribute_map = {
"authority": {"key": "authority", "type": "str"},
"audience": {"key": "audience", "type": "str"},
"smart_proxy_enabled": {"key": "smartProxyEnabled", "type": "bool"},
"smart_identity_providers": {"key": "smartIdentityProviders", "type": "[SmartIdentityProviderConfiguration]"},
}
def __init__(
@ -896,6 +915,7 @@ class FhirServiceAuthenticationConfiguration(_serialization.Model):
authority: Optional[str] = None,
audience: Optional[str] = None,
smart_proxy_enabled: Optional[bool] = None,
smart_identity_providers: Optional[List["_models.SmartIdentityProviderConfiguration"]] = None,
**kwargs: Any
) -> None:
"""
@ -905,11 +925,16 @@ class FhirServiceAuthenticationConfiguration(_serialization.Model):
:paramtype audience: str
:keyword smart_proxy_enabled: If the SMART on FHIR proxy is enabled.
:paramtype smart_proxy_enabled: bool
:keyword smart_identity_providers: The array of identity provider configurations for SMART on
FHIR authentication.
:paramtype smart_identity_providers:
list[~azure.mgmt.healthcareapis.models.SmartIdentityProviderConfiguration]
"""
super().__init__(**kwargs)
self.authority = authority
self.audience = audience
self.smart_proxy_enabled = smart_proxy_enabled
self.smart_identity_providers = smart_identity_providers
class FhirServiceCollection(_serialization.Model):
@ -1299,7 +1324,7 @@ class IotDestinationProperties(_serialization.Model):
self.provisioning_state = None
class IotEventHubIngestionEndpointConfiguration(_serialization.Model):
class IotEventHubIngestionEndpointConfiguration(_serialization.Model): # pylint: disable=name-too-long
"""Event Hub ingestion endpoint configuration.
:ivar event_hub_name: Event Hub name to connect to.
@ -1345,7 +1370,7 @@ class IotFhirDestination(LocationBasedResource):
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar id: The resource identifier.
:vartype id: str
@ -1470,7 +1495,7 @@ class IotFhirDestinationProperties(IotDestinationProperties):
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar provisioning_state: The provisioning state. Known values are: "Deleting", "Succeeded",
"Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned",
@ -1993,7 +2018,7 @@ class Resource(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@ -2028,7 +2053,7 @@ class PrivateEndpointConnection(Resource):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@ -2093,7 +2118,7 @@ class PrivateEndpointConnectionDescription(PrivateEndpointConnection):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@ -2178,7 +2203,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model):
self.value = value
class PrivateEndpointConnectionListResultDescription(_serialization.Model):
class PrivateEndpointConnectionListResultDescription(_serialization.Model): # pylint: disable=name-too-long
"""List of private endpoint connection associated with the specified storage account.
:ivar value: Array of private endpoint connections.
@ -2206,7 +2231,7 @@ class PrivateLinkResource(Resource):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@ -2255,7 +2280,7 @@ class PrivateLinkResourceDescription(PrivateLinkResource):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@ -2407,7 +2432,7 @@ class ResourceVersionPolicyConfiguration(_serialization.Model):
class ServiceAccessPolicyEntry(_serialization.Model):
"""An access policy entry.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar object_id: An Azure AD object ID (User or Apps) that is allowed access to the FHIR
service. Required.
@ -2675,7 +2700,7 @@ class ServiceManagedIdentityIdentity(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar type: Type of identity being specified, currently SystemAssigned and None are allowed.
Required. Known values are: "None", "SystemAssigned", "UserAssigned", and
@ -2689,7 +2714,7 @@ class ServiceManagedIdentityIdentity(_serialization.Model):
:vartype tenant_id: str
:ivar user_assigned_identities: The set of user assigned identities associated with the
resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long
The dictionary values can be empty objects ({}) in requests.
:vartype user_assigned_identities: dict[str,
~azure.mgmt.healthcareapis.models.UserAssignedIdentity]
@ -2722,7 +2747,7 @@ class ServiceManagedIdentityIdentity(_serialization.Model):
:paramtype type: str or ~azure.mgmt.healthcareapis.models.ServiceManagedIdentityType
:keyword user_assigned_identities: The set of user assigned identities associated with the
resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long
The dictionary values can be empty objects ({}) in requests.
:paramtype user_assigned_identities: dict[str,
~azure.mgmt.healthcareapis.models.UserAssignedIdentity]
@ -2778,7 +2803,7 @@ class ServicesResource(_serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar id: The resource identifier.
:vartype id: str
@ -2861,7 +2886,7 @@ class ServicesDescription(ServicesResource):
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.
:ivar id: The resource identifier.
:vartype id: str
@ -3226,6 +3251,117 @@ class ServicesResourceIdentity(_serialization.Model):
self.type = type
class SmartIdentityProviderApplication(_serialization.Model):
"""An Application configured in the Identity Provider used to access FHIR resources.
:ivar client_id: The application client id defined in the identity provider. This value will be
used to validate bearer tokens against the given authority.
:vartype client_id: str
:ivar audience: The audience that will be used to validate bearer tokens against the given
authority.
:vartype audience: str
:ivar allowed_data_actions: The actions that are permitted to be performed on FHIR resources
for the application.
:vartype allowed_data_actions: list[str or ~azure.mgmt.healthcareapis.models.SmartDataActions]
"""
_attribute_map = {
"client_id": {"key": "clientId", "type": "str"},
"audience": {"key": "audience", "type": "str"},
"allowed_data_actions": {"key": "allowedDataActions", "type": "[str]"},
}
def __init__(
self,
*,
client_id: Optional[str] = None,
audience: Optional[str] = None,
allowed_data_actions: Optional[List[Union[str, "_models.SmartDataActions"]]] = None,
**kwargs: Any
) -> None:
"""
:keyword client_id: The application client id defined in the identity provider. This value will
be used to validate bearer tokens against the given authority.
:paramtype client_id: str
:keyword audience: The audience that will be used to validate bearer tokens against the given
authority.
:paramtype audience: str
:keyword allowed_data_actions: The actions that are permitted to be performed on FHIR resources
for the application.
:paramtype allowed_data_actions: list[str or
~azure.mgmt.healthcareapis.models.SmartDataActions]
"""
super().__init__(**kwargs)
self.client_id = client_id
self.audience = audience
self.allowed_data_actions = allowed_data_actions
class SmartIdentityProviderConfiguration(_serialization.Model):
"""An object to configure an identity provider for use with SMART on FHIR authentication.
:ivar authority: The identity provider token authority also known as the token issuing
authority.
:vartype authority: str
:ivar applications: The array of identity provider applications for SMART on FHIR
authentication.
:vartype applications: list[~azure.mgmt.healthcareapis.models.SmartIdentityProviderApplication]
"""
_attribute_map = {
"authority": {"key": "authority", "type": "str"},
"applications": {"key": "applications", "type": "[SmartIdentityProviderApplication]"},
}
def __init__(
self,
*,
authority: Optional[str] = None,
applications: Optional[List["_models.SmartIdentityProviderApplication"]] = None,
**kwargs: Any
) -> None:
"""
:keyword authority: The identity provider token authority also known as the token issuing
authority.
:paramtype authority: str
:keyword applications: The array of identity provider applications for SMART on FHIR
authentication.
:paramtype applications:
list[~azure.mgmt.healthcareapis.models.SmartIdentityProviderApplication]
"""
super().__init__(**kwargs)
self.authority = authority
self.applications = applications
class StorageConfiguration(_serialization.Model):
"""The configuration of connected storage.
:ivar storage_resource_id: The resource id of connected storage account.
:vartype storage_resource_id: str
:ivar file_system_name: The filesystem name of connected storage account.
:vartype file_system_name: str
"""
_attribute_map = {
"storage_resource_id": {"key": "storageResourceId", "type": "str"},
"file_system_name": {"key": "fileSystemName", "type": "str"},
}
def __init__(
self, *, storage_resource_id: Optional[str] = None, file_system_name: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword storage_resource_id: The resource id of connected storage account.
:paramtype storage_resource_id: str
:keyword file_system_name: The filesystem name of connected storage account.
:paramtype file_system_name: str
"""
super().__init__(**kwargs)
self.storage_resource_id = storage_resource_id
self.file_system_name = file_system_name
class SystemData(_serialization.Model):
"""Metadata pertaining to creation and last modification of the resource.
@ -3420,17 +3556,6 @@ class WorkspacePatchResource(ResourceTags):
:vartype tags: dict[str, str]
"""
_attribute_map = {
"tags": {"key": "tags", "type": "{str}"},
}
def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
"""
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
"""
super().__init__(tags=tags, **kwargs)
class WorkspaceProperties(_serialization.Model):
"""Workspaces resource specific properties.

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -45,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -78,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -114,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -153,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -192,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -252,7 +252,6 @@ class DicomServicesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DicomService or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.DicomService]
:raises ~azure.core.exceptions.HttpResponseError:
@ -274,17 +273,16 @@ class DicomServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -296,13 +294,13 @@ class DicomServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("DicomServiceCollection", pipeline_response)
@ -312,11 +310,11 @@ class DicomServicesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -329,10 +327,6 @@ class DicomServicesOperations:
return ItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices"
}
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, dicom_service_name: str, **kwargs: Any
@ -346,7 +340,6 @@ class DicomServicesOperations:
:type workspace_name: str
:param dicom_service_name: The name of DICOM Service resource. Required.
:type dicom_service_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DicomService or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.DicomService
:raises ~azure.core.exceptions.HttpResponseError:
@ -365,22 +358,21 @@ class DicomServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
dicom_service_name=dicom_service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -393,20 +385,16 @@ class DicomServicesOperations:
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: Union[_models.DicomService, IO],
dicomservice: Union[_models.DicomService, IO[bytes]],
**kwargs: Any
) -> _models.DicomService:
error_map = {
@ -432,7 +420,7 @@ class DicomServicesOperations:
else:
_json = self._serialize.body(dicomservice, "DicomService")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
dicom_service_name=dicom_service_name,
@ -441,16 +429,15 @@ class DicomServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -474,10 +461,6 @@ class DicomServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
@overload
def begin_create_or_update(
self,
@ -504,14 +487,6 @@ class DicomServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -524,7 +499,7 @@ class DicomServicesOperations:
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: IO,
dicomservice: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -540,18 +515,10 @@ class DicomServicesOperations:
:type dicom_service_name: str
:param dicomservice: The parameters for creating or updating a Dicom Service resource.
Required.
:type dicomservice: IO
:type dicomservice: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -564,7 +531,7 @@ class DicomServicesOperations:
resource_group_name: str,
workspace_name: str,
dicom_service_name: str,
dicomservice: Union[_models.DicomService, IO],
dicomservice: Union[_models.DicomService, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.DicomService]:
"""Creates or updates a DICOM Service resource with the specified parameters.
@ -577,19 +544,8 @@ class DicomServicesOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
either a DicomService type or a IO[bytes] type. Required.
:type dicomservice: ~azure.mgmt.healthcareapis.models.DicomService or IO[bytes]
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -622,7 +578,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -632,24 +588,22 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.DicomService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return LROPoller[_models.DicomService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _update_initial(
self,
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO],
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.DicomService:
error_map = {
@ -675,7 +629,7 @@ class DicomServicesOperations:
else:
_json = self._serialize.body(dicomservice_patch_resource, "DicomServicePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
dicom_service_name=dicom_service_name,
workspace_name=workspace_name,
@ -684,16 +638,15 @@ class DicomServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -714,10 +667,6 @@ class DicomServicesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
@overload
def begin_update(
self,
@ -743,14 +692,6 @@ class DicomServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -763,7 +704,7 @@ class DicomServicesOperations:
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: IO,
dicomservice_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -778,18 +719,10 @@ class DicomServicesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param dicomservice_patch_resource: The parameters for updating a Dicom Service. Required.
:type dicomservice_patch_resource: IO
:type dicomservice_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -802,7 +735,7 @@ class DicomServicesOperations:
resource_group_name: str,
dicom_service_name: str,
workspace_name: str,
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO],
dicomservice_patch_resource: Union[_models.DicomServicePatchResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.DicomService]:
"""Patch DICOM Service details.
@ -815,20 +748,9 @@ class DicomServicesOperations:
: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
DicomServicePatchResource type or a IO type. Required.
DicomServicePatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or IO[bytes]
:return: An instance of LROPoller that returns either DicomService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.DicomService]
@ -861,7 +783,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DicomService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -871,17 +793,15 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.DicomService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return LROPoller[_models.DicomService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, dicom_service_name: str, workspace_name: str, **kwargs: Any
@ -900,22 +820,21 @@ class DicomServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
dicom_service_name=dicom_service_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -926,11 +845,7 @@ class DicomServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -945,14 +860,6 @@ class DicomServicesOperations:
:type dicom_service_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -980,7 +887,7 @@ class DicomServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -989,14 +896,10 @@ class DicomServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -42,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -104,7 +104,6 @@ class FhirDestinationsOperations:
:type workspace_name: str
:param iot_connector_name: The name of IoT Connector resource. Required.
:type iot_connector_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IotFhirDestination or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.IotFhirDestination]
:raises ~azure.core.exceptions.HttpResponseError:
@ -126,18 +125,17 @@ class FhirDestinationsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_iot_connector_request(
_request = build_list_by_iot_connector_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_iot_connector.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -149,13 +147,13 @@ class FhirDestinationsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("IotFhirDestinationCollection", pipeline_response)
@ -165,11 +163,11 @@ class FhirDestinationsOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -181,7 +179,3 @@ class FhirDestinationsOperations:
return pipeline_response
return ItemPaged(get_next, extract_data)
list_by_iot_connector.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations"
}

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -45,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -78,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -112,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -149,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -186,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -244,7 +244,6 @@ class FhirServicesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either FhirService or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.FhirService]
:raises ~azure.core.exceptions.HttpResponseError:
@ -266,17 +265,16 @@ class FhirServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -288,13 +286,13 @@ class FhirServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("FhirServiceCollection", pipeline_response)
@ -304,11 +302,11 @@ class FhirServicesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -321,10 +319,6 @@ class FhirServicesOperations:
return ItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices"
}
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, fhir_service_name: str, **kwargs: Any
@ -338,7 +332,6 @@ class FhirServicesOperations:
:type workspace_name: str
:param fhir_service_name: The name of FHIR Service resource. Required.
:type fhir_service_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: FhirService or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.FhirService
:raises ~azure.core.exceptions.HttpResponseError:
@ -357,22 +350,21 @@ class FhirServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
fhir_service_name=fhir_service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -385,20 +377,16 @@ class FhirServicesOperations:
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: Union[_models.FhirService, IO],
fhirservice: Union[_models.FhirService, IO[bytes]],
**kwargs: Any
) -> _models.FhirService:
error_map = {
@ -424,7 +412,7 @@ class FhirServicesOperations:
else:
_json = self._serialize.body(fhirservice, "FhirService")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
fhir_service_name=fhir_service_name,
@ -433,16 +421,15 @@ class FhirServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -466,10 +453,6 @@ class FhirServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
@overload
def begin_create_or_update(
self,
@ -495,14 +478,6 @@ class FhirServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -515,7 +490,7 @@ class FhirServicesOperations:
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: IO,
fhirservice: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -530,18 +505,10 @@ class FhirServicesOperations:
: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. Required.
:type fhirservice: IO
:type fhirservice: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -554,7 +521,7 @@ class FhirServicesOperations:
resource_group_name: str,
workspace_name: str,
fhir_service_name: str,
fhirservice: Union[_models.FhirService, IO],
fhirservice: Union[_models.FhirService, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.FhirService]:
"""Creates or updates a FHIR Service resource with the specified parameters.
@ -567,19 +534,8 @@ class FhirServicesOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
a FhirService type or a IO[bytes] type. Required.
:type fhirservice: ~azure.mgmt.healthcareapis.models.FhirService or IO[bytes]
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -612,7 +568,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -622,24 +578,22 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.FhirService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return LROPoller[_models.FhirService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _update_initial(
self,
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO],
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.FhirService:
error_map = {
@ -665,7 +619,7 @@ class FhirServicesOperations:
else:
_json = self._serialize.body(fhirservice_patch_resource, "FhirServicePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
fhir_service_name=fhir_service_name,
workspace_name=workspace_name,
@ -674,16 +628,15 @@ class FhirServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -704,10 +657,6 @@ class FhirServicesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
@overload
def begin_update(
self,
@ -733,14 +682,6 @@ class FhirServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -753,7 +694,7 @@ class FhirServicesOperations:
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: IO,
fhirservice_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -768,18 +709,10 @@ class FhirServicesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param fhirservice_patch_resource: The parameters for updating a Fhir Service. Required.
:type fhirservice_patch_resource: IO
:type fhirservice_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -792,7 +725,7 @@ class FhirServicesOperations:
resource_group_name: str,
fhir_service_name: str,
workspace_name: str,
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO],
fhirservice_patch_resource: Union[_models.FhirServicePatchResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.FhirService]:
"""Patch FHIR Service details.
@ -805,20 +738,9 @@ class FhirServicesOperations:
: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
FhirServicePatchResource type or a IO type. Required.
FhirServicePatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
IO[bytes]
:return: An instance of LROPoller that returns either FhirService or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.FhirService]
@ -851,7 +773,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("FhirService", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -861,17 +783,15 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.FhirService].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return LROPoller[_models.FhirService](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, fhir_service_name: str, workspace_name: str, **kwargs: Any
@ -890,22 +810,21 @@ class FhirServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
fhir_service_name=fhir_service_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -916,11 +835,7 @@ class FhirServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -935,14 +850,6 @@ class FhirServicesOperations:
:type fhir_service_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -970,7 +877,7 @@ class FhirServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -979,14 +886,10 @@ class FhirServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -48,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -92,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -139,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -211,7 +211,6 @@ class IotConnectorFhirDestinationOperations:
:type iot_connector_name: str
:param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required.
:type fhir_destination_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IotFhirDestination or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.IotFhirDestination
:raises ~azure.core.exceptions.HttpResponseError:
@ -230,23 +229,22 @@ class IotConnectorFhirDestinationOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
fhir_destination_name=fhir_destination_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -259,13 +257,9 @@ class IotConnectorFhirDestinationOperations:
deserialized = self._deserialize("IotFhirDestination", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
@ -273,7 +267,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: Union[_models.IotFhirDestination, IO],
iot_fhir_destination: Union[_models.IotFhirDestination, IO[bytes]],
**kwargs: Any
) -> _models.IotFhirDestination:
error_map = {
@ -299,7 +293,7 @@ class IotConnectorFhirDestinationOperations:
else:
_json = self._serialize.body(iot_fhir_destination, "IotFhirDestination")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
@ -309,16 +303,15 @@ class IotConnectorFhirDestinationOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -342,10 +335,6 @@ class IotConnectorFhirDestinationOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
@overload
def begin_create_or_update(
self,
@ -375,14 +364,6 @@ class IotConnectorFhirDestinationOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotFhirDestination]
@ -396,7 +377,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: IO,
iot_fhir_destination: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -414,18 +395,10 @@ class IotConnectorFhirDestinationOperations:
:type fhir_destination_name: str
:param iot_fhir_destination: The parameters for creating or updating an IoT Connector FHIR
destination resource. Required.
:type iot_fhir_destination: IO
:type iot_fhir_destination: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotFhirDestination]
@ -439,7 +412,7 @@ class IotConnectorFhirDestinationOperations:
workspace_name: str,
iot_connector_name: str,
fhir_destination_name: str,
iot_fhir_destination: Union[_models.IotFhirDestination, IO],
iot_fhir_destination: Union[_models.IotFhirDestination, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.IotFhirDestination]:
"""Creates or updates an IoT Connector FHIR destination resource with the specified parameters.
@ -454,19 +427,8 @@ class IotConnectorFhirDestinationOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
destination resource. Is either a IotFhirDestination type or a IO[bytes] type. Required.
:type iot_fhir_destination: ~azure.mgmt.healthcareapis.models.IotFhirDestination or IO[bytes]
:return: An instance of LROPoller that returns either IotFhirDestination or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotFhirDestination]
@ -500,7 +462,7 @@ class IotConnectorFhirDestinationOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotFhirDestination", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -510,17 +472,15 @@ class IotConnectorFhirDestinationOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.IotFhirDestination].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return LROPoller[_models.IotFhirDestination](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
@ -544,23 +504,22 @@ class IotConnectorFhirDestinationOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
fhir_destination_name=fhir_destination_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -571,11 +530,7 @@ class IotConnectorFhirDestinationOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -597,14 +552,6 @@ class IotConnectorFhirDestinationOperations:
:type iot_connector_name: str
:param fhir_destination_name: The name of IoT Connector FHIR destination resource. Required.
:type fhir_destination_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -633,7 +580,7 @@ class IotConnectorFhirDestinationOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -642,14 +589,10 @@ class IotConnectorFhirDestinationOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -45,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -78,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -114,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -153,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -192,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -252,7 +252,6 @@ class IotConnectorsOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IotConnector or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.IotConnector]
:raises ~azure.core.exceptions.HttpResponseError:
@ -274,17 +273,16 @@ class IotConnectorsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -296,13 +294,13 @@ class IotConnectorsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("IotConnectorCollection", pipeline_response)
@ -312,11 +310,11 @@ class IotConnectorsOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -329,10 +327,6 @@ class IotConnectorsOperations:
return ItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors"
}
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, iot_connector_name: str, **kwargs: Any
@ -346,7 +340,6 @@ class IotConnectorsOperations:
:type workspace_name: str
:param iot_connector_name: The name of IoT Connector resource. Required.
:type iot_connector_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IotConnector or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.IotConnector
:raises ~azure.core.exceptions.HttpResponseError:
@ -365,22 +358,21 @@ class IotConnectorsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -393,20 +385,16 @@ class IotConnectorsOperations:
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: Union[_models.IotConnector, IO],
iot_connector: Union[_models.IotConnector, IO[bytes]],
**kwargs: Any
) -> _models.IotConnector:
error_map = {
@ -432,7 +420,7 @@ class IotConnectorsOperations:
else:
_json = self._serialize.body(iot_connector, "IotConnector")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
iot_connector_name=iot_connector_name,
@ -441,16 +429,15 @@ class IotConnectorsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -474,10 +461,6 @@ class IotConnectorsOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
@overload
def begin_create_or_update(
self,
@ -504,14 +487,6 @@ class IotConnectorsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -524,7 +499,7 @@ class IotConnectorsOperations:
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: IO,
iot_connector: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -540,18 +515,10 @@ class IotConnectorsOperations:
:type iot_connector_name: str
:param iot_connector: The parameters for creating or updating an IoT Connectors resource.
Required.
:type iot_connector: IO
:type iot_connector: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -564,7 +531,7 @@ class IotConnectorsOperations:
resource_group_name: str,
workspace_name: str,
iot_connector_name: str,
iot_connector: Union[_models.IotConnector, IO],
iot_connector: Union[_models.IotConnector, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.IotConnector]:
"""Creates or updates an IoT Connector resource with the specified parameters.
@ -577,19 +544,8 @@ class IotConnectorsOperations:
: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 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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
either a IotConnector type or a IO[bytes] type. Required.
:type iot_connector: ~azure.mgmt.healthcareapis.models.IotConnector or IO[bytes]
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -622,7 +578,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -632,24 +588,22 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.IotConnector].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return LROPoller[_models.IotConnector](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _update_initial(
self,
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO],
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO[bytes]],
**kwargs: Any
) -> _models.IotConnector:
error_map = {
@ -675,7 +629,7 @@ class IotConnectorsOperations:
else:
_json = self._serialize.body(iot_connector_patch_resource, "IotConnectorPatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
iot_connector_name=iot_connector_name,
workspace_name=workspace_name,
@ -684,16 +638,15 @@ class IotConnectorsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -714,10 +667,6 @@ class IotConnectorsOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
@overload
def begin_update(
self,
@ -743,14 +692,6 @@ class IotConnectorsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -763,7 +704,7 @@ class IotConnectorsOperations:
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: IO,
iot_connector_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -778,18 +719,10 @@ class IotConnectorsOperations:
: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. Required.
:type iot_connector_patch_resource: IO
:type iot_connector_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -802,7 +735,7 @@ class IotConnectorsOperations:
resource_group_name: str,
iot_connector_name: str,
workspace_name: str,
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO],
iot_connector_patch_resource: Union[_models.IotConnectorPatchResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.IotConnector]:
"""Patch an IoT Connector.
@ -815,20 +748,9 @@ class IotConnectorsOperations:
: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
IotConnectorPatchResource type or a IO type. Required.
IotConnectorPatchResource type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or IO[bytes]
:return: An instance of LROPoller that returns either IotConnector or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.IotConnector]
@ -861,7 +783,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("IotConnector", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -871,17 +793,15 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.IotConnector].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return LROPoller[_models.IotConnector](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, iot_connector_name: str, workspace_name: str, **kwargs: Any
@ -900,22 +820,21 @@ class IotConnectorsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
iot_connector_name=iot_connector_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -926,11 +845,7 @@ class IotConnectorsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -945,14 +860,6 @@ class IotConnectorsOperations:
:type iot_connector_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -980,7 +887,7 @@ class IotConnectorsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -989,14 +896,10 @@ class IotConnectorsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -38,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -90,7 +90,6 @@ class OperationResultsOperations:
:type location_name: str
:param operation_result_id: The ID of the operation result to get. Required.
:type operation_result_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: OperationResultsDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.OperationResultsDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -109,21 +108,20 @@ class OperationResultsOperations:
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(
_request = build_get_request(
location_name=location_name,
operation_result_id=operation_result_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -136,10 +134,6 @@ class OperationResultsOperations:
deserialized = self._deserialize("OperationResultsDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -78,7 +78,6 @@ class Operations:
def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]:
"""Lists all of the available operations supported by Microsoft Healthcare resource provider.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationDetail or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.OperationDetail]
:raises ~azure.core.exceptions.HttpResponseError:
@ -100,14 +99,13 @@ class Operations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
_request = build_list_request(
api_version=api_version,
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -119,13 +117,13 @@ class Operations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ListOperations", pipeline_response)
@ -135,11 +133,11 @@ class Operations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -151,5 +149,3 @@ class Operations:
return pipeline_response
return ItemPaged(get_next, extract_data)
list.metadata = {"url": "/providers/Microsoft.HealthcareApis/operations"}

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -45,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -82,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -122,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -165,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -225,7 +225,6 @@ class PrivateEndpointConnectionsOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateEndpointConnectionDescription or the result
of cls(response)
:rtype:
@ -249,17 +248,16 @@ class PrivateEndpointConnectionsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_service_request(
_request = build_list_by_service_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_service.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -271,13 +269,13 @@ class PrivateEndpointConnectionsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionListResultDescription", pipeline_response)
@ -287,11 +285,11 @@ class PrivateEndpointConnectionsOperations:
return None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -304,10 +302,6 @@ class PrivateEndpointConnectionsOperations:
return ItemPaged(get_next, extract_data)
list_by_service.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections"
}
@distributed_trace
def get(
self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -322,7 +316,6 @@ class PrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateEndpointConnectionDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -341,22 +334,21 @@ class PrivateEndpointConnectionsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -369,20 +361,16 @@ class PrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnection, IO],
properties: Union[_models.PrivateEndpointConnection, IO[bytes]],
**kwargs: Any
) -> _models.PrivateEndpointConnectionDescription:
error_map = {
@ -408,7 +396,7 @@ class PrivateEndpointConnectionsOperations:
else:
_json = self._serialize.body(properties, "PrivateEndpointConnection")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@ -417,16 +405,15 @@ class PrivateEndpointConnectionsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -439,13 +426,9 @@ class PrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
@overload
def begin_create_or_update(
@ -473,14 +456,6 @@ class PrivateEndpointConnectionsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -494,7 +469,7 @@ class PrivateEndpointConnectionsOperations:
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: IO,
properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -510,18 +485,10 @@ class PrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param properties: The private endpoint connection properties. Required.
:type properties: IO
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -535,7 +502,7 @@ class PrivateEndpointConnectionsOperations:
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnection, IO],
properties: Union[_models.PrivateEndpointConnection, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionDescription]:
"""Update the state of the specified private endpoint connection associated with the service.
@ -549,19 +516,8 @@ class PrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
PrivateEndpointConnection type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnection or IO[bytes]
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -595,7 +551,7 @@ class PrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -605,17 +561,15 @@ class PrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.PrivateEndpointConnectionDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return LROPoller[_models.PrivateEndpointConnectionDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -634,22 +588,21 @@ class PrivateEndpointConnectionsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -660,11 +613,7 @@ class PrivateEndpointConnectionsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -680,14 +629,6 @@ class PrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -715,7 +656,7 @@ class PrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -724,14 +665,10 @@ class PrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -40,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -73,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -131,7 +131,6 @@ class PrivateLinkResourcesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceListResultDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceListResultDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -150,21 +149,20 @@ class PrivateLinkResourcesOperations:
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(
_request = build_list_by_service_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_service.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -177,13 +175,9 @@ class PrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceListResultDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
list_by_service.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources"
}
return deserialized # type: ignore
@distributed_trace
def get(
@ -198,7 +192,6 @@ class PrivateLinkResourcesOperations:
:type resource_name: str
:param group_name: The name of the private link resource group. Required.
:type group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -217,22 +210,21 @@ class PrivateLinkResourcesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
group_name=group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -245,10 +237,6 @@ class PrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -43,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -76,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -112,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -148,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -179,7 +179,7 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -203,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -233,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -286,7 +286,6 @@ class ServicesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -305,21 +304,20 @@ class ServicesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -332,19 +330,15 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
resource_name: str,
service_description: Union[_models.ServicesDescription, IO],
service_description: Union[_models.ServicesDescription, IO[bytes]],
**kwargs: Any
) -> _models.ServicesDescription:
error_map = {
@ -370,7 +364,7 @@ class ServicesOperations:
else:
_json = self._serialize.body(service_description, "ServicesDescription")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
@ -378,16 +372,15 @@ class ServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -408,10 +401,6 @@ class ServicesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
@overload
def begin_create_or_update(
self,
@ -434,14 +423,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -453,7 +434,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_description: IO,
service_description: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -466,18 +447,10 @@ class ServicesOperations:
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:param service_description: The service instance metadata. Required.
:type service_description: IO
:type service_description: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -489,7 +462,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_description: Union[_models.ServicesDescription, IO],
service_description: Union[_models.ServicesDescription, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ServicesDescription]:
"""Create or update the metadata of a service instance.
@ -500,19 +473,8 @@ class ServicesOperations:
:param resource_name: The name of the service instance. Required.
:type resource_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
or a IO[bytes] type. Required.
:type service_description: ~azure.mgmt.healthcareapis.models.ServicesDescription or IO[bytes]
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -544,7 +506,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -554,23 +516,21 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.ServicesDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return LROPoller[_models.ServicesDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _update_initial(
self,
resource_group_name: str,
resource_name: str,
service_patch_description: Union[_models.ServicesPatchDescription, IO],
service_patch_description: Union[_models.ServicesPatchDescription, IO[bytes]],
**kwargs: Any
) -> _models.ServicesDescription:
error_map = {
@ -596,7 +556,7 @@ class ServicesOperations:
else:
_json = self._serialize.body(service_patch_description, "ServicesPatchDescription")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
@ -604,16 +564,15 @@ class ServicesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -626,13 +585,9 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return deserialized # type: ignore
@overload
def begin_update(
@ -657,14 +612,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -676,7 +623,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_patch_description: IO,
service_patch_description: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -690,18 +637,10 @@ class ServicesOperations:
:type resource_name: str
:param service_patch_description: The service instance metadata and security metadata.
Required.
:type service_patch_description: IO
:type service_patch_description: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -713,7 +652,7 @@ class ServicesOperations:
self,
resource_group_name: str,
resource_name: str,
service_patch_description: Union[_models.ServicesPatchDescription, IO],
service_patch_description: Union[_models.ServicesPatchDescription, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ServicesDescription]:
"""Update the metadata of a service instance.
@ -724,20 +663,9 @@ class ServicesOperations:
: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 ServicesPatchDescription type or a IO type. Required.
either a ServicesPatchDescription type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
IO[bytes]
:return: An instance of LROPoller that returns either ServicesDescription or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.ServicesDescription]
@ -769,7 +697,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServicesDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -779,17 +707,15 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.ServicesDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return LROPoller[_models.ServicesDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, resource_name: str, **kwargs: Any
@ -808,21 +734,20 @@ class ServicesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
resource_name=resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -833,11 +758,7 @@ class ServicesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]:
@ -848,14 +769,6 @@ class ServicesOperations:
:type resource_group_name: str
:param resource_name: The name of the service instance. Required.
:type resource_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -882,7 +795,7 @@ class ServicesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -891,23 +804,18 @@ class ServicesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.ServicesDescription"]:
"""Get all the service instances in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ServicesDescription or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.ServicesDescription]
:raises ~azure.core.exceptions.HttpResponseError:
@ -929,15 +837,14 @@ class ServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -949,13 +856,13 @@ class ServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ServicesDescriptionListResult", pipeline_response)
@ -965,11 +872,11 @@ class ServicesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -982,8 +889,6 @@ class ServicesOperations:
return ItemPaged(get_next, extract_data)
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services"}
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
@ -993,7 +898,6 @@ class ServicesOperations:
:param resource_group_name: The name of the resource group that contains the service instance.
Required.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ServicesDescription or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.ServicesDescription]
:raises ~azure.core.exceptions.HttpResponseError:
@ -1015,16 +919,15 @@ class ServicesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_resource_group_request(
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_resource_group.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -1036,13 +939,13 @@ class ServicesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ServicesDescriptionListResult", pipeline_response)
@ -1052,11 +955,11 @@ class ServicesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -1069,10 +972,6 @@ class ServicesOperations:
return ItemPaged(get_next, extract_data)
list_by_resource_group.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services"
}
@overload
def check_name_availability(
self,
@ -1091,7 +990,6 @@ class ServicesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -1099,18 +997,17 @@ class ServicesOperations:
@overload
def check_name_availability(
self, check_name_availability_inputs: IO, *, content_type: str = "application/json", **kwargs: Any
self, check_name_availability_inputs: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ServicesNameAvailabilityInfo:
"""Check if a service instance name is available.
:param check_name_availability_inputs: Set the name parameter in the
CheckNameAvailabilityParameters structure to the name of the service instance to check.
Required.
:type check_name_availability_inputs: IO
:type check_name_availability_inputs: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -1118,19 +1015,15 @@ class ServicesOperations:
@distributed_trace
def check_name_availability(
self, check_name_availability_inputs: Union[_models.CheckNameAvailabilityParameters, IO], **kwargs: Any
self, check_name_availability_inputs: Union[_models.CheckNameAvailabilityParameters, IO[bytes]], **kwargs: Any
) -> _models.ServicesNameAvailabilityInfo:
"""Check if a service instance name is available.
: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 CheckNameAvailabilityParameters type or a IO type. Required.
either a CheckNameAvailabilityParameters type or a IO[bytes] 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'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
~azure.mgmt.healthcareapis.models.CheckNameAvailabilityParameters or IO[bytes]
:return: ServicesNameAvailabilityInfo or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.ServicesNameAvailabilityInfo
:raises ~azure.core.exceptions.HttpResponseError:
@ -1158,22 +1051,21 @@ class ServicesOperations:
else:
_json = self._serialize.body(check_name_availability_inputs, "CheckNameAvailabilityParameters")
request = build_check_name_availability_request(
_request = build_check_name_availability_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
template_url=self.check_name_availability.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -1186,10 +1078,6 @@ class ServicesOperations:
deserialized = self._deserialize("ServicesNameAvailabilityInfo", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
check_name_availability.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -45,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -82,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -122,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -165,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -195,7 +195,7 @@ def build_delete_request(
return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
class WorkspacePrivateEndpointConnectionsOperations:
class WorkspacePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@ -225,7 +225,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateEndpointConnectionDescription or the result
of cls(response)
:rtype:
@ -249,17 +248,16 @@ class WorkspacePrivateEndpointConnectionsOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -271,13 +269,13 @@ class WorkspacePrivateEndpointConnectionsOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionListResultDescription", pipeline_response)
@ -287,11 +285,11 @@ class WorkspacePrivateEndpointConnectionsOperations:
return None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -304,10 +302,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
return ItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections"
}
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -322,7 +316,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateEndpointConnectionDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -341,22 +334,21 @@ class WorkspacePrivateEndpointConnectionsOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -369,20 +361,16 @@ class WorkspacePrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnectionDescription, IO],
properties: Union[_models.PrivateEndpointConnectionDescription, IO[bytes]],
**kwargs: Any
) -> _models.PrivateEndpointConnectionDescription:
error_map = {
@ -408,7 +396,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
_json = self._serialize.body(properties, "PrivateEndpointConnectionDescription")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@ -417,16 +405,15 @@ class WorkspacePrivateEndpointConnectionsOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -439,13 +426,9 @@ class WorkspacePrivateEndpointConnectionsOperations:
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return deserialized # type: ignore
@overload
def begin_create_or_update(
@ -473,14 +456,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -494,7 +469,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: IO,
properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -510,18 +485,10 @@ class WorkspacePrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param properties: The private endpoint connection properties. Required.
:type properties: IO
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -535,7 +502,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
resource_group_name: str,
workspace_name: str,
private_endpoint_connection_name: str,
properties: Union[_models.PrivateEndpointConnectionDescription, IO],
properties: Union[_models.PrivateEndpointConnectionDescription, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionDescription]:
"""Update the state of the specified private endpoint connection associated with the workspace.
@ -549,19 +516,9 @@ class WorkspacePrivateEndpointConnectionsOperations:
with the Azure resource. Required.
:type private_endpoint_connection_name: str
: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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
PrivateEndpointConnectionDescription type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.healthcareapis.models.PrivateEndpointConnectionDescription or
IO[bytes]
:return: An instance of LROPoller that returns either PrivateEndpointConnectionDescription or
the result of cls(response)
:rtype:
@ -595,7 +552,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -605,17 +562,15 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.PrivateEndpointConnectionDescription].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return LROPoller[_models.PrivateEndpointConnectionDescription](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any
@ -634,22 +589,21 @@ class WorkspacePrivateEndpointConnectionsOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -660,11 +614,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
@ -680,14 +630,6 @@ class WorkspacePrivateEndpointConnectionsOperations:
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -715,7 +657,7 @@ class WorkspacePrivateEndpointConnectionsOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -724,14 +666,10 @@ class WorkspacePrivateEndpointConnectionsOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -42,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -75,7 +75,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -133,7 +133,6 @@ class WorkspacePrivateLinkResourcesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PrivateLinkResourceDescription or the result of
cls(response)
:rtype:
@ -157,17 +156,16 @@ class WorkspacePrivateLinkResourcesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_workspace_request(
_request = build_list_by_workspace_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_workspace.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -179,13 +177,13 @@ class WorkspacePrivateLinkResourcesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateLinkResourceListResultDescription", pipeline_response)
@ -195,11 +193,11 @@ class WorkspacePrivateLinkResourcesOperations:
return None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -212,10 +210,6 @@ class WorkspacePrivateLinkResourcesOperations:
return ItemPaged(get_next, extract_data)
list_by_workspace.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources"
}
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, group_name: str, **kwargs: Any
@ -229,7 +223,6 @@ class WorkspacePrivateLinkResourcesOperations:
:type workspace_name: str
:param group_name: The name of the private link resource group. Required.
:type group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PrivateLinkResourceDescription or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.PrivateLinkResourceDescription
:raises ~azure.core.exceptions.HttpResponseError:
@ -248,22 +241,21 @@ class WorkspacePrivateLinkResourcesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
group_name=group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -276,10 +268,6 @@ class WorkspacePrivateLinkResourcesOperations:
deserialized = self._deserialize("PrivateLinkResourceDescription", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}"
}
return deserialized # type: ignore

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@ -43,7 +43,7 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -67,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -99,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -132,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -168,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@ -204,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: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-31"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@ -254,7 +254,6 @@ class WorkspacesOperations:
def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Workspace"]:
"""Lists all the available workspaces under the specified subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Workspace or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -276,15 +275,14 @@ class WorkspacesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_subscription_request(
_request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_subscription.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -296,13 +294,13 @@ class WorkspacesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("WorkspaceList", pipeline_response)
@ -312,11 +310,11 @@ class WorkspacesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -329,10 +327,6 @@ class WorkspacesOperations:
return ItemPaged(get_next, extract_data)
list_by_subscription.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces"
}
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Workspace"]:
"""Lists all the available workspaces under the specified resource group.
@ -340,7 +334,6 @@ class WorkspacesOperations:
:param resource_group_name: The name of the resource group that contains the service instance.
Required.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Workspace or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -362,16 +355,15 @@ class WorkspacesOperations:
def prepare_request(next_link=None):
if not next_link:
request = build_list_by_resource_group_request(
_request = build_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_resource_group.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@ -383,13 +375,13 @@ class WorkspacesOperations:
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("WorkspaceList", pipeline_response)
@ -399,11 +391,11 @@ class WorkspacesOperations:
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -416,10 +408,6 @@ class WorkspacesOperations:
return ItemPaged(get_next, extract_data)
list_by_resource_group.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces"
}
@distributed_trace
def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace:
"""Gets the properties of the specified workspace.
@ -429,7 +417,6 @@ class WorkspacesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Workspace or the result of cls(response)
:rtype: ~azure.mgmt.healthcareapis.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
@ -448,21 +435,20 @@ class WorkspacesOperations:
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(
_request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -475,16 +461,16 @@ class WorkspacesOperations:
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return deserialized # type: ignore
def _create_or_update_initial(
self, resource_group_name: str, workspace_name: str, workspace: Union[_models.Workspace, IO], **kwargs: Any
self,
resource_group_name: str,
workspace_name: str,
workspace: Union[_models.Workspace, IO[bytes]],
**kwargs: Any
) -> _models.Workspace:
error_map = {
401: ClientAuthenticationError,
@ -509,7 +495,7 @@ class WorkspacesOperations:
else:
_json = self._serialize.body(workspace, "Workspace")
request = build_create_or_update_request(
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@ -517,16 +503,15 @@ class WorkspacesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._create_or_update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -550,10 +535,6 @@ class WorkspacesOperations:
return deserialized # type: ignore
_create_or_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
@overload
def begin_create_or_update(
self,
@ -576,14 +557,6 @@ class WorkspacesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -594,7 +567,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace: IO,
workspace: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -607,18 +580,10 @@ class WorkspacesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param workspace: The parameters for creating or updating a healthcare workspace. Required.
:type workspace: IO
:type workspace: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -626,7 +591,11 @@ class WorkspacesOperations:
@distributed_trace
def begin_create_or_update(
self, resource_group_name: str, workspace_name: str, workspace: Union[_models.Workspace, IO], **kwargs: Any
self,
resource_group_name: str,
workspace_name: str,
workspace: Union[_models.Workspace, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.Workspace]:
"""Creates or updates a workspace resource with the specified parameters.
@ -636,19 +605,8 @@ class WorkspacesOperations:
: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
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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Workspace type or a IO[bytes] type. Required.
:type workspace: ~azure.mgmt.healthcareapis.models.Workspace or IO[bytes]
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -679,7 +637,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -689,23 +647,21 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.Workspace].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_create_or_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return LROPoller[_models.Workspace](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _update_initial(
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO],
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO[bytes]],
**kwargs: Any
) -> _models.Workspace:
error_map = {
@ -731,7 +687,7 @@ class WorkspacesOperations:
else:
_json = self._serialize.body(workspace_patch_resource, "WorkspacePatchResource")
request = build_update_request(
_request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@ -739,16 +695,15 @@ class WorkspacesOperations:
content_type=content_type,
json=_json,
content=_content,
template_url=self._update_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -769,10 +724,6 @@ class WorkspacesOperations:
return deserialized # type: ignore
_update_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
@overload
def begin_update(
self,
@ -795,14 +746,6 @@ class WorkspacesOperations:
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -813,7 +756,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: IO,
workspace_patch_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@ -826,18 +769,10 @@ class WorkspacesOperations:
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:param workspace_patch_resource: The parameters for updating a specified workspace. Required.
:type workspace_patch_resource: IO
:type workspace_patch_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -848,7 +783,7 @@ class WorkspacesOperations:
self,
resource_group_name: str,
workspace_name: str,
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO],
workspace_patch_resource: Union[_models.WorkspacePatchResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.Workspace]:
"""Patch workspace details.
@ -859,19 +794,9 @@ class WorkspacesOperations:
: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
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.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
WorkspacePatchResource type or a IO[bytes] type. Required.
:type workspace_patch_resource: ~azure.mgmt.healthcareapis.models.WorkspacePatchResource or
IO[bytes]
:return: An instance of LROPoller that returns either Workspace or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.healthcareapis.models.Workspace]
:raises ~azure.core.exceptions.HttpResponseError:
@ -902,7 +827,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("Workspace", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
@ -912,17 +837,15 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[_models.Workspace].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_update.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return LROPoller[_models.Workspace](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, **kwargs: Any
@ -941,21 +864,20 @@ class WorkspacesOperations:
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(
_request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@ -966,11 +888,7 @@ class WorkspacesOperations:
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> LROPoller[None]:
@ -981,14 +899,6 @@ class WorkspacesOperations:
:type resource_group_name: str
:param workspace_name: The name of workspace resource. Required.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
@ -1015,7 +925,7 @@ class WorkspacesOperations:
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
@ -1024,14 +934,10 @@ class WorkspacesOperations:
else:
polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
begin_delete.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}"
}
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -35,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/CheckNameAvailabilityPost.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/CheckNameAvailabilityPost.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -33,11 +36,20 @@ def main():
resource_group_name="testRG",
workspace_name="workspace1",
dicom_service_name="blue",
dicomservice={"location": "westus", "properties": {}},
dicomservice={
"location": "westus",
"properties": {
"enableDataPartitions": False,
"storageConfiguration": {
"fileSystemName": "fileSystemName",
"storageResourceId": "/subscriptions/ab309d4e-4c2e-4241-be2e-08e1c8dd4246/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/accountname",
},
},
},
).result()
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/dicomservices/DicomServices_Create.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/dicomservices/DicomServices_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/dicomservices/DicomServices_Delete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/dicomservices/DicomServices_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/dicomservices/DicomServices_Get.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/dicomservices/DicomServices_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/dicomservices/DicomServices_List.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/dicomservices/DicomServices_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -38,6 +41,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/dicomservices/DicomServices_Patch.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/dicomservices/DicomServices_Patch.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -47,6 +50,18 @@ def main():
"authenticationConfiguration": {
"audience": "https://azurehealthcareapis.com",
"authority": "https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc",
"smartIdentityProviders": [
{
"applications": [
{
"allowedDataActions": ["Read"],
"audience": "22222222-2222-2222-2222-222222222222",
"clientId": "22222222-2222-2222-2222-222222222222",
}
],
"authority": "https://login.b2clogin.com/11111111-1111-1111-1111-111111111111/v2.0",
}
],
"smartProxyEnabled": True,
},
"corsConfiguration": {
@ -75,6 +90,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/fhirservices/FhirServices_Create.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/fhirservices/FhirServices_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/fhirservices/FhirServices_Delete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/fhirservices/FhirServices_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/fhirservices/FhirServices_Get.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/fhirservices/FhirServices_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/fhirservices/FhirServices_List.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/fhirservices/FhirServices_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -38,6 +41,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/fhirservices/FhirServices_Patch.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/fhirservices/FhirServices_Patch.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -68,6 +71,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_Create.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_Delete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -68,6 +71,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_fhirdestination_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_fhirdestination_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -38,6 +39,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_fhirdestination_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -38,6 +39,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_fhirdestination_List.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_fhirdestination_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_Get.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_List.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -41,6 +44,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/iotconnectors/iotconnector_Patch.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/iotconnectors/iotconnector_Patch.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/PrivateLinkResourceGet.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/PrivateLinkResourceGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/PrivateLinkResourcesListByService.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/PrivateLinkResourcesListByService.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -67,6 +70,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceCreate.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -68,6 +71,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceCreateInDataSovereignRegionWithCmkEnabled.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceCreateInDataSovereignRegionWithCmkEnabled.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -42,6 +45,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceCreateMinimum.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceCreateMinimum.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -40,6 +43,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceCreatePrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -35,6 +36,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceDelete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceDeletePrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceGet.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceGetInDataSovereignRegionWithCmkEnabled.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceGetInDataSovereignRegionWithCmkEnabled.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceGetPrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceGetPrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -34,6 +35,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceList.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceListByResourceGroup.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceListByResourceGroup.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServiceListPrivateEndpointConnections.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServiceListPrivateEndpointConnections.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +40,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/legacy/ServicePatch.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/legacy/ServicePatch.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/OperationResultsGet.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/OperationResultsGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -34,6 +35,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/OperationsList.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/OperationsList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/PrivateLinkResourcesListByWorkspace.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -40,6 +43,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/WorkspaceListPrivateEndpointConnections.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +38,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/privatelink/WorkspacePrivateLinkResourceGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +40,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_Create.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -35,6 +36,6 @@ def main():
).result()
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_Delete.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_Get.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -36,6 +37,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_ListByResourceGroup.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_ListByResourceGroup.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -34,6 +35,6 @@ def main():
print(item)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_ListBySubscription.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_ListBySubscription.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -6,7 +6,10 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.healthcareapis import HealthcareApisManagementClient
"""
@ -37,6 +40,6 @@ def main():
print(response)
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2023-11-01/examples/workspaces/Workspaces_Patch.json
# x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2024-03-31/examples/workspaces/Workspaces_Patch.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -53,11 +53,11 @@ setup(
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
],
zip_safe=False,
@ -74,10 +74,9 @@ setup(
"pytyped": ["py.typed"],
},
install_requires=[
"isodate<1.0.0,>=0.6.1",
"azure-common~=1.1",
"azure-mgmt-core>=1.3.2,<2.0.0",
"typing-extensions>=4.3.0; python_version<'3.8.0'",
"isodate>=0.6.1",
"azure-common>=1.1",
"azure-mgmt-core>=1.3.2",
],
python_requires=">=3.7",
python_requires=">=3.8",
)