diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/_meta.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/_meta.json index e16855b5e34c..a54f7e9cfdca 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/_meta.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/_meta.json @@ -1,11 +1,11 @@ { - "commit": "2f2e48923cebd95f7d184608a29bcd06d9cb3653", + "commit": "e2b5c08c05b34eb5883bdcce73635588f60002f7", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.7", + "@autorest/python@6.4.0", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/digitaltwins/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/digitaltwins/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/digitaltwins/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/_serialization.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/_serialization.py index 2c170e28dbca..25467dfc00bb 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/_serialization.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,15 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[ + [str, Dict[str, Any], Any], Any + ] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +408,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +420,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +438,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +547,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +563,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,8 +655,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -656,8 +684,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -777,6 +805,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -1161,7 +1191,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1332,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=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1383,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1471,7 +1502,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1517,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1527,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_azure_digital_twins_management_client.py index 7be0cc594bb1..27973d5538ac 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_azure_digital_twins_management_client.py @@ -97,5 +97,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_metadata.json index 44f92e7c1c11..31bc748f4816 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/_azure_digital_twins_management_client.py index a560dd0313f3..f73b6d5bc06d 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/_azure_digital_twins_management_client.py @@ -97,5 +97,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_endpoint_operations.py index f10f6650296d..f22bfa6f7623 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_endpoint_operations.py @@ -406,7 +406,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -536,7 +536,7 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( self, resource_group_name: str, resource_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: + ) -> AsyncLROPoller[_models.DigitalTwinsEndpointResource]: """Delete a DigitalTwinsInstance endpoint. :param resource_group_name: The name of the resource group that contains the diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_operations.py index 880be3a75e37..f18fe62bb183 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/aio/operations/_digital_twins_operations.py @@ -301,8 +301,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -536,7 +536,7 @@ async def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -662,7 +662,9 @@ async def _delete_initial( } @distributed_trace_async - async def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def begin_delete( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.DigitalTwinsDescription]: """Delete a DigitalTwinsInstance. :param resource_group_name: The name of the resource group that contains the @@ -970,7 +972,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py index ffb0bfad9769..05deaf500057 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/models/_models_py3.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -42,7 +42,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -80,8 +80,8 @@ def __init__( name: Optional[str] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -144,8 +144,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, sku: Optional["_models.DigitalTwinsSkuInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -224,8 +224,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, sku: Optional["_models.DigitalTwinsSkuInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -261,8 +261,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -300,7 +300,7 @@ class ExternalResource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -337,7 +337,9 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: Optional["_models.DigitalTwinsEndpointResourceProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.DigitalTwinsEndpointResourceProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. :paramtype properties: @@ -367,8 +369,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -419,7 +421,7 @@ class DigitalTwinsEndpointResourceProperties(_serialization.Model): _subtype_map = {"endpoint_type": {"EventGrid": "EventGrid", "EventHub": "EventHub", "ServiceBus": "ServiceBus"}} - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: The resource tags. :paramtype tags: dict[str, str] @@ -442,7 +444,7 @@ class DigitalTwinsPatchDescription(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Instance tags. :paramtype tags: dict[str, str] @@ -468,7 +470,7 @@ class DigitalTwinsSkuInfo(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Union[str, "_models.DigitalTwinsSku"], **kwargs): + def __init__(self, *, name: Union[str, "_models.DigitalTwinsSku"], **kwargs: Any) -> None: """ :keyword name: The name of the SKU. Required. "F1" :paramtype name: str or ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsSku @@ -502,7 +504,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -521,7 +523,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.ErrorDefinition @@ -581,8 +583,8 @@ def __init__( access_key2: str, tags: Optional[Dict[str, str]] = None, topic_endpoint: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: The resource tags. :paramtype tags: dict[str, str] @@ -649,8 +651,8 @@ def __init__( connection_string_primary_key: str, connection_string_secondary_key: str, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: The resource tags. :paramtype tags: dict[str, str] @@ -687,7 +689,7 @@ class Operation(_serialization.Model): "display": {"key": "display", "type": "OperationDisplay"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.OperationDisplay @@ -726,7 +728,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -736,7 +738,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -756,7 +759,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -815,8 +818,8 @@ def __init__( primary_connection_string: str, secondary_connection_string: str, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: The resource tags. :paramtype tags: dict[str, str] diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_endpoint_operations.py index 3a817262064f..d26ff10113c2 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_endpoint_operations.py @@ -555,7 +555,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -685,7 +685,7 @@ def _delete_initial( @distributed_trace def begin_delete( self, resource_group_name: str, resource_name: str, endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: + ) -> LROPoller[_models.DigitalTwinsEndpointResource]: """Delete a DigitalTwinsInstance endpoint. :param resource_group_name: The name of the resource group that contains the diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_operations.py index 22b5357290c9..4ca69fe011d2 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_03_01_preview/operations/_digital_twins_operations.py @@ -532,8 +532,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -767,7 +767,7 @@ def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -893,7 +893,9 @@ def _delete_initial( } @distributed_trace - def begin_delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + def begin_delete( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[_models.DigitalTwinsDescription]: """Delete a DigitalTwinsInstance. :param resource_group_name: The name of the resource group that contains the @@ -1201,7 +1203,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_azure_digital_twins_management_client.py index 1243aafd13fd..e9f0e1eacbcf 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_azure_digital_twins_management_client.py @@ -96,5 +96,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_metadata.json index f50be20b5938..c123e457a11d 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/_azure_digital_twins_management_client.py index 9b3de706f75c..6f1622f54a9d 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/_azure_digital_twins_management_client.py @@ -97,5 +97,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_endpoint_operations.py index 621fd541a461..84c8cbaafacf 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_endpoint_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_operations.py index 0e09d4527a84..c2597b3b2224 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/aio/operations/_digital_twins_operations.py @@ -296,8 +296,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -440,7 +440,7 @@ async def update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -872,7 +872,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_10_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/models/_models_py3.py index f60b9ab60385..65f45b8b7fb8 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/models/_models_py3.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -42,7 +42,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -76,8 +76,8 @@ def __init__( name_available: Optional[bool] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -128,7 +128,7 @@ class DigitalTwinsResource(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -196,7 +196,7 @@ class DigitalTwinsDescription(DigitalTwinsResource): "host_name": {"key": "properties.hostName", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -229,8 +229,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -267,7 +267,7 @@ class ExternalResource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -307,7 +307,7 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs): + def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs: Any) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. Required. :paramtype properties: @@ -336,8 +336,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -389,7 +389,7 @@ class DigitalTwinsEndpointResourceProperties(_serialization.Model): _subtype_map = {"endpoint_type": {"EventGrid": "EventGrid", "EventHub": "EventHub", "ServiceBus": "ServiceBus"}} - def __init__(self, *, dead_letter_secret: Optional[str] = None, **kwargs): + def __init__(self, *, dead_letter_secret: Optional[str] = None, **kwargs: Any) -> None: """ :keyword dead_letter_secret: Dead letter storage secret. Will be obfuscated during read. :paramtype dead_letter_secret: str @@ -412,7 +412,7 @@ class DigitalTwinsPatchDescription(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Instance tags. :paramtype tags: dict[str, str] @@ -446,7 +446,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -465,7 +465,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2020_10_31.models.ErrorDefinition @@ -526,8 +526,8 @@ def __init__( access_key1: str, dead_letter_secret: Optional[str] = None, access_key2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword dead_letter_secret: Dead letter storage secret. Will be obfuscated during read. :paramtype dead_letter_secret: str @@ -594,8 +594,8 @@ def __init__( connection_string_primary_key: str, dead_letter_secret: Optional[str] = None, connection_string_secondary_key: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword dead_letter_secret: Dead letter storage secret. Will be obfuscated during read. :paramtype dead_letter_secret: str @@ -640,7 +640,7 @@ class Operation(_serialization.Model): "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2020_10_31.models.OperationDisplay @@ -681,7 +681,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -691,7 +691,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -711,7 +712,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -770,8 +771,8 @@ def __init__( primary_connection_string: str, dead_letter_secret: Optional[str] = None, secondary_connection_string: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword dead_letter_secret: Dead letter storage secret. Will be obfuscated during read. :paramtype dead_letter_secret: str diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_endpoint_operations.py index 3d674fdc7304..34bfb0822f41 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_endpoint_operations.py @@ -584,7 +584,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_operations.py index 9487dcafebeb..0507006b2376 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_10_31/operations/_digital_twins_operations.py @@ -541,8 +541,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -685,7 +685,7 @@ def update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_10_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1117,7 +1117,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_10_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py index 35c3888efbcb..5f9c9b215f69 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_azure_digital_twins_management_client.py @@ -114,5 +114,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_metadata.json index f132fd93270d..6010d3c25e68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/_azure_digital_twins_management_client.py index 66eb765512f3..ce15018f6ec3 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/_azure_digital_twins_management_client.py @@ -115,5 +115,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_endpoint_operations.py index 9a0d95bf9fe2..b1a6763be1fe 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_endpoint_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_operations.py index f2c4983f87ee..92016863f703 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_digital_twins_operations.py @@ -296,8 +296,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -529,7 +529,7 @@ async def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -958,7 +958,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_12_01.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py index e5a1ccb1f386..fafff8cd72e4 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py @@ -485,7 +485,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2020_12_01.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models_py3.py index e9a778c9e063..7664adc7ef66 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/models/_models_py3.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -42,7 +42,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -76,8 +76,8 @@ def __init__( name_available: Optional[bool] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -135,8 +135,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ConnectionPropertiesPrivateLinkServiceConnectionState" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: :paramtype private_endpoint: @@ -171,7 +171,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -194,7 +194,7 @@ class ConnectionPropertiesPrivateEndpoint(PrivateEndpoint): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -232,8 +232,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -284,8 +284,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -343,8 +343,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -438,8 +438,8 @@ def __init__( identity: Optional["_models.DigitalTwinsIdentity"] = None, private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -483,8 +483,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -521,7 +521,7 @@ class ExternalResource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -561,7 +561,7 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs): + def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs: Any) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. Required. :paramtype properties: @@ -590,8 +590,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -658,8 +658,8 @@ def __init__( authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None, dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Known values are: "KeyBased" and "IdentityBased". @@ -709,7 +709,7 @@ class DigitalTwinsIdentity(_serialization.Model): "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs): + def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: The type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Known values are: "None" and "SystemAssigned". @@ -744,8 +744,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, properties: Optional["_models.DigitalTwinsPatchProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Instance patch properties. :paramtype tags: dict[str, str] @@ -773,7 +773,9 @@ class DigitalTwinsPatchProperties(_serialization.Model): "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, } - def __init__(self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs): + def __init__( + self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any + ) -> None: """ :keyword public_network_access: Public network access for the DigitalTwinsInstance. Known values are: "Enabled" and "Disabled". @@ -809,7 +811,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -828,7 +830,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2020_12_01.models.ErrorDefinition @@ -900,8 +902,8 @@ def __init__( dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, access_key2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Known values are: "KeyBased" and "IdentityBased". @@ -1000,8 +1002,8 @@ def __init__( connection_string_secondary_key: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Known values are: "KeyBased" and "IdentityBased". @@ -1073,8 +1075,8 @@ def __init__( *, properties: "_models.GroupIdInformationProperties", id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2020_12_01.models.GroupIdInformationProperties @@ -1111,8 +1113,8 @@ def __init__( group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_id: The group id. :paramtype group_id: str @@ -1150,8 +1152,8 @@ def __init__( group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_id: The group id. :paramtype group_id: str @@ -1176,7 +1178,7 @@ class GroupIdInformationResponse(_serialization.Model): "value": {"key": "value", "type": "[GroupIdInformation]"}, } - def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link resources for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2020_12_01.models.GroupIdInformation] @@ -1213,7 +1215,7 @@ class Operation(_serialization.Model): "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2020_12_01.models.OperationDisplay @@ -1254,7 +1256,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1264,7 +1266,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1284,7 +1287,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -1326,7 +1329,7 @@ class PrivateEndpointConnection(_serialization.Model): "properties": {"key": "properties", "type": "PrivateEndpointConnectionProperties"}, } - def __init__(self, *, properties: "_models.PrivateEndpointConnectionProperties", **kwargs): + def __init__(self, *, properties: "_models.PrivateEndpointConnectionProperties", **kwargs: Any) -> None: """ :keyword properties: Required. :paramtype properties: @@ -1380,8 +1383,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ConnectionPropertiesPrivateLinkServiceConnectionState" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: :paramtype private_endpoint: @@ -1411,7 +1414,7 @@ class PrivateEndpointConnectionsResponse(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link connections for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2020_12_01.models.PrivateEndpointConnection] @@ -1488,8 +1491,8 @@ def __init__( secondary_connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Known values are: "KeyBased" and "IdentityBased". diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py index eb14735909b3..3606824e7816 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_endpoint_operations.py @@ -584,7 +584,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py index f1e48585b9b9..4ba99d80d8da 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_digital_twins_operations.py @@ -541,8 +541,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -774,7 +774,7 @@ def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2020_12_01.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1203,7 +1203,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2020_12_01.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py index 8e7f1371de33..ff9121366da9 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2020_12_01/operations/_private_endpoint_connections_operations.py @@ -667,7 +667,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2020_12_01.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_azure_digital_twins_management_client.py index e750c96db3dd..ac4425248d0b 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_azure_digital_twins_management_client.py @@ -122,5 +122,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_metadata.json index 6ec803aad75b..a8d40f3b5ac0 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/_azure_digital_twins_management_client.py index f4fd00513f2f..8c0df5fa7489 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/_azure_digital_twins_management_client.py @@ -122,5 +122,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_endpoint_operations.py index 87d2d749d126..b50e8d83414a 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_endpoint_operations.py @@ -406,7 +406,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_operations.py index 7dde3ee0e2d5..63187d008b91 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_digital_twins_operations.py @@ -301,8 +301,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -538,7 +538,7 @@ async def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -977,7 +977,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_private_endpoint_connections_operations.py index c8bf54a031f5..982d14e360e7 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_private_endpoint_connections_operations.py @@ -495,7 +495,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_time_series_database_connections_operations.py index 662108a46eb9..876d85af593c 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/aio/operations/_time_series_database_connections_operations.py @@ -406,7 +406,7 @@ async def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/models/_models_py3.py index c6f0c046f0ff..9b22773fcfe7 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -50,7 +50,7 @@ class TimeSeriesDatabaseConnectionProperties(_serialization.Model): _subtype_map = {"connection_type": {"AzureDataExplorer": "AzureDataExplorerConnectionProperties"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.connection_type: Optional[str] = None @@ -58,7 +58,8 @@ def __init__(self, **kwargs): class AzureDataExplorerConnectionProperties(TimeSeriesDatabaseConnectionProperties): - """Properties of a time series database connection to Azure Data Explorer with data being sent via an EventHub. + """Properties of a time series database connection to Azure Data Explorer with data being sent via + an EventHub. Variables are only populated by the server, and will be ignored when sending a request. @@ -129,8 +130,8 @@ def __init__( event_hub_namespace_resource_id: str, adx_table_name: str = "AdtPropertyEvents", event_hub_consumer_group: str = "$Default", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword adx_resource_id: The resource ID of the Azure Data Explorer cluster. Required. :paramtype adx_resource_id: str @@ -191,7 +192,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -225,8 +226,8 @@ def __init__( name_available: Optional[bool] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -283,8 +284,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ConnectionPropertiesPrivateLinkServiceConnectionState" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The private endpoint. :paramtype private_endpoint: @@ -335,8 +336,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -387,8 +388,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -451,8 +452,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -552,8 +553,8 @@ def __init__( identity: Optional["_models.DigitalTwinsIdentity"] = None, private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -598,8 +599,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -641,7 +642,7 @@ class ExternalResource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -686,7 +687,7 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs): + def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs: Any) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. Required. :paramtype properties: @@ -716,8 +717,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -787,8 +788,8 @@ def __init__( authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None, dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -842,7 +843,7 @@ class DigitalTwinsIdentity(_serialization.Model): "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs): + def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: The type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Known values are: "None" and "SystemAssigned". @@ -879,8 +880,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, properties: Optional["_models.DigitalTwinsPatchProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Instance patch properties. :paramtype tags: dict[str, str] @@ -909,7 +910,9 @@ class DigitalTwinsPatchProperties(_serialization.Model): "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, } - def __init__(self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs): + def __init__( + self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any + ) -> None: """ :keyword public_network_access: Public network access for the DigitalTwinsInstance. Known values are: "Enabled" and "Disabled". @@ -945,7 +948,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -964,7 +967,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.ErrorDefinition @@ -1039,8 +1042,8 @@ def __init__( dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, access_key2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1145,8 +1148,8 @@ def __init__( connection_string_secondary_key: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1222,8 +1225,8 @@ def __init__( *, properties: "_models.GroupIdInformationProperties", id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword properties: The group information properties. Required. :paramtype properties: @@ -1261,8 +1264,8 @@ def __init__( group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_id: The group id. :paramtype group_id: str @@ -1288,7 +1291,7 @@ class GroupIdInformationResponse(_serialization.Model): "value": {"key": "value", "type": "[GroupIdInformation]"}, } - def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link resources for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2021_06_30_preview.models.GroupIdInformation] @@ -1329,7 +1332,7 @@ class Operation(_serialization.Model): "properties": {"key": "properties", "type": "{object}"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.OperationDisplay @@ -1371,7 +1374,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1381,7 +1384,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1401,7 +1405,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -1428,7 +1432,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1470,7 +1474,7 @@ class PrivateEndpointConnection(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs): + def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs: Any) -> None: """ :keyword properties: The connection properties. Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.ConnectionProperties @@ -1495,7 +1499,7 @@ class PrivateEndpointConnectionsResponse(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link connections for a Digital Twin. :paramtype value: @@ -1576,8 +1580,8 @@ def __init__( secondary_connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1655,8 +1659,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1717,7 +1721,9 @@ class TimeSeriesDatabaseConnection(ExternalResource): "properties": {"key": "properties", "type": "TimeSeriesDatabaseConnectionProperties"}, } - def __init__(self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties of a specific time series database connection. :paramtype properties: @@ -1747,8 +1753,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.TimeSeriesDatabaseConnection"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of results. :paramtype next_link: str diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_endpoint_operations.py index 938b3bda8187..f2127dddce88 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_endpoint_operations.py @@ -598,7 +598,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_operations.py index 7e807a5cac55..a593c737865a 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_digital_twins_operations.py @@ -560,8 +560,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -797,7 +797,7 @@ def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1236,7 +1236,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_private_endpoint_connections_operations.py index b1e3d332d575..fe10eccb3174 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_private_endpoint_connections_operations.py @@ -685,7 +685,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_time_series_database_connections_operations.py index 3430af93b0b5..57b482e72edf 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2021_06_30_preview/operations/_time_series_database_connections_operations.py @@ -610,7 +610,7 @@ def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2021_06_30_preview.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_azure_digital_twins_management_client.py index 593f55421211..c5e3f3781e12 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_azure_digital_twins_management_client.py @@ -121,5 +121,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_metadata.json index 36d31c322566..abaf36a9f38c 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/_azure_digital_twins_management_client.py index 5e5d606eca10..00af944a28ff 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/_azure_digital_twins_management_client.py @@ -122,5 +122,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_endpoint_operations.py index c282a6a1f895..52d828552dca 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_endpoint_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_operations.py index 30cddfcbb9e6..92276af7f1d9 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_digital_twins_operations.py @@ -296,8 +296,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -529,7 +529,7 @@ async def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -958,7 +958,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2022_05_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_private_endpoint_connections_operations.py index 016e498f2e51..600a423deecc 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_private_endpoint_connections_operations.py @@ -485,7 +485,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2022_05_31.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_time_series_database_connections_operations.py index 7b4795ed70c1..39376c88a1dd 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/aio/operations/_time_series_database_connections_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/models/_models_py3.py index efbd8749b7d0..f93ada6c62ee 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -49,7 +49,7 @@ class TimeSeriesDatabaseConnectionProperties(_serialization.Model): _subtype_map = {"connection_type": {"AzureDataExplorer": "AzureDataExplorerConnectionProperties"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.connection_type: Optional[str] = None @@ -57,7 +57,8 @@ def __init__(self, **kwargs): class AzureDataExplorerConnectionProperties(TimeSeriesDatabaseConnectionProperties): - """Properties of a time series database connection to Azure Data Explorer with data being sent via an EventHub. + """Properties of a time series database connection to Azure Data Explorer with data being sent via + an EventHub. Variables are only populated by the server, and will be ignored when sending a request. @@ -127,8 +128,8 @@ def __init__( event_hub_namespace_resource_id: str, adx_table_name: str = "AdtPropertyEvents", event_hub_consumer_group: str = "$Default", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword adx_resource_id: The resource ID of the Azure Data Explorer cluster. Required. :paramtype adx_resource_id: str @@ -189,7 +190,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -223,8 +224,8 @@ def __init__( name_available: Optional[bool] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -281,8 +282,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ConnectionPropertiesPrivateLinkServiceConnectionState" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The private endpoint. :paramtype private_endpoint: ~azure.mgmt.digitaltwins.v2022_05_31.models.PrivateEndpoint @@ -332,8 +333,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -384,8 +385,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -448,8 +449,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -549,8 +550,8 @@ def __init__( identity: Optional["_models.DigitalTwinsIdentity"] = None, private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -594,8 +595,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -636,7 +637,7 @@ class ExternalResource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -681,7 +682,7 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs): + def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs: Any) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. Required. :paramtype properties: @@ -710,8 +711,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -781,8 +782,8 @@ def __init__( authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None, dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -835,7 +836,7 @@ class DigitalTwinsIdentity(_serialization.Model): "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs): + def __init__(self, *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: The type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Known values are: "None" and "SystemAssigned". @@ -870,8 +871,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, properties: Optional["_models.DigitalTwinsPatchProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Instance patch properties. :paramtype tags: dict[str, str] @@ -899,7 +900,9 @@ class DigitalTwinsPatchProperties(_serialization.Model): "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, } - def __init__(self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs): + def __init__( + self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any + ) -> None: """ :keyword public_network_access: Public network access for the DigitalTwinsInstance. Known values are: "Enabled" and "Disabled". @@ -935,7 +938,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -954,7 +957,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2022_05_31.models.ErrorDefinition @@ -1029,8 +1032,8 @@ def __init__( dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, access_key2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1135,8 +1138,8 @@ def __init__( connection_string_secondary_key: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1211,8 +1214,8 @@ def __init__( *, properties: "_models.GroupIdInformationProperties", id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword properties: The group information properties. Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2022_05_31.models.GroupIdInformationProperties @@ -1249,8 +1252,8 @@ def __init__( group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_id: The group id. :paramtype group_id: str @@ -1276,7 +1279,7 @@ class GroupIdInformationResponse(_serialization.Model): "value": {"key": "value", "type": "[GroupIdInformation]"}, } - def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link resources for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2022_05_31.models.GroupIdInformation] @@ -1317,7 +1320,7 @@ class Operation(_serialization.Model): "properties": {"key": "properties", "type": "{object}"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2022_05_31.models.OperationDisplay @@ -1359,7 +1362,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1369,7 +1372,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1389,7 +1393,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -1416,7 +1420,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1458,7 +1462,7 @@ class PrivateEndpointConnection(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs): + def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs: Any) -> None: """ :keyword properties: The connection properties. Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2022_05_31.models.ConnectionProperties @@ -1482,7 +1486,7 @@ class PrivateEndpointConnectionsResponse(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link connections for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2022_05_31.models.PrivateEndpointConnection] @@ -1562,8 +1566,8 @@ def __init__( secondary_connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1640,8 +1644,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1701,7 +1705,9 @@ class TimeSeriesDatabaseConnection(ExternalResource): "properties": {"key": "properties", "type": "TimeSeriesDatabaseConnectionProperties"}, } - def __init__(self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties of a specific time series database connection. :paramtype properties: @@ -1730,8 +1736,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.TimeSeriesDatabaseConnection"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of results. :paramtype next_link: str diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_endpoint_operations.py index b43c55c06252..31a563f727b3 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_endpoint_operations.py @@ -584,7 +584,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_operations.py index 13c7f4744898..b39cf5ea15bb 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_digital_twins_operations.py @@ -541,8 +541,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -774,7 +774,7 @@ def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1203,7 +1203,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2022_05_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_private_endpoint_connections_operations.py index 0bdacad5f375..dbb0078f22a7 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_private_endpoint_connections_operations.py @@ -667,7 +667,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2022_05_31.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_time_series_database_connections_operations.py index 0417705ebd4c..c84713c176ea 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_05_31/operations/_time_series_database_connections_operations.py @@ -596,7 +596,7 @@ def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2022_05_31.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_azure_digital_twins_management_client.py index 8c81dab19b2d..472f9f45e0a3 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_azure_digital_twins_management_client.py @@ -121,5 +121,5 @@ def __enter__(self) -> "AzureDigitalTwinsManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_metadata.json b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_metadata.json index be37a4586de0..7e3de7326222 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_metadata.json +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_metadata.json @@ -19,13 +19,15 @@ "signature": "credential: \"TokenCredential\",", "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { "signature": "subscription_id: str,", "description": "The subscription identifier. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { @@ -51,19 +53,22 @@ "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "signature": "api_version: Optional[str] = None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "base_url": { "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_vendor.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_vendor.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_version.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_version.py index f519b2e2f369..e5754a47ce68 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_version.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.3.0" +VERSION = "1.0.0b1" diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/_azure_digital_twins_management_client.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/_azure_digital_twins_management_client.py index 2f3be7b2803b..b66ae3bcc9a4 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/_azure_digital_twins_management_client.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/_azure_digital_twins_management_client.py @@ -122,5 +122,5 @@ async def __aenter__(self) -> "AzureDigitalTwinsManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_endpoint_operations.py index 1f7b250be9c2..dbc45f172d6c 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_endpoint_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_operations.py index f61a53693a41..49853b010234 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_digital_twins_operations.py @@ -296,8 +296,8 @@ async def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -529,7 +529,7 @@ async def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -958,7 +958,7 @@ async def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2022_10_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_private_endpoint_connections_operations.py index 5d1a690d969f..ad3931b9a04f 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_private_endpoint_connections_operations.py @@ -485,7 +485,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2022_10_31.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_time_series_database_connections_operations.py index 2a850319ddf8..45d613aa5d5f 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/aio/operations/_time_series_database_connections_operations.py @@ -400,7 +400,7 @@ async def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/models/_models_py3.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/models/_models_py3.py index 6e131afd8d7d..0ee037c1f245 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/models/_models_py3.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization @@ -52,7 +52,7 @@ class TimeSeriesDatabaseConnectionProperties(_serialization.Model): _subtype_map = {"connection_type": {"AzureDataExplorer": "AzureDataExplorerConnectionProperties"}} - def __init__(self, *, identity: Optional["_models.ManagedIdentityReference"] = None, **kwargs): + def __init__(self, *, identity: Optional["_models.ManagedIdentityReference"] = None, **kwargs: Any) -> None: """ :keyword identity: Managed identity properties for the time series database connection resource. @@ -67,7 +67,8 @@ def __init__(self, *, identity: Optional["_models.ManagedIdentityReference"] = N class AzureDataExplorerConnectionProperties( TimeSeriesDatabaseConnectionProperties ): # pylint: disable=too-many-instance-attributes - """Properties of a time series database connection to Azure Data Explorer with data being sent via an EventHub. + """Properties of a time series database connection to Azure Data Explorer with data being sent via + an EventHub. Variables are only populated by the server, and will be ignored when sending a request. @@ -141,8 +142,8 @@ def __init__( identity: Optional["_models.ManagedIdentityReference"] = None, adx_table_name: str = "AdtPropertyEvents", event_hub_consumer_group: str = "$Default", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword identity: Managed identity properties for the time series database connection resource. @@ -206,7 +207,7 @@ class CheckNameRequest(_serialization.Model): type = "Microsoft.DigitalTwins/digitalTwinsInstances" - def __init__(self, *, name: str, **kwargs): + def __init__(self, *, name: str, **kwargs: Any) -> None: """ :keyword name: Resource name. Required. :paramtype name: str @@ -240,8 +241,8 @@ def __init__( name_available: Optional[bool] = None, message: Optional[str] = None, reason: Optional[Union[str, "_models.Reason"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Specifies a Boolean value that indicates if the name is available. :paramtype name_available: bool @@ -298,8 +299,8 @@ def __init__( private_link_service_connection_state: Optional[ "_models.ConnectionPropertiesPrivateLinkServiceConnectionState" ] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: The private endpoint. :paramtype private_endpoint: ~azure.mgmt.digitaltwins.v2022_10_31.models.PrivateEndpoint @@ -349,8 +350,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -401,8 +402,8 @@ def __init__( status: Union[str, "_models.PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: The status of a private endpoint connection. Required. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". @@ -465,8 +466,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -566,8 +567,8 @@ def __init__( identity: Optional["_models.DigitalTwinsIdentity"] = None, private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The resource location. Required. :paramtype location: str @@ -611,8 +612,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsDescription"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -653,7 +654,7 @@ class ExternalResource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -698,7 +699,7 @@ class DigitalTwinsEndpointResource(ExternalResource): "properties": {"key": "properties", "type": "DigitalTwinsEndpointResourceProperties"}, } - def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs): + def __init__(self, *, properties: "_models.DigitalTwinsEndpointResourceProperties", **kwargs: Any) -> None: """ :keyword properties: DigitalTwinsInstance endpoint resource properties. Required. :paramtype properties: @@ -727,8 +728,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.DigitalTwinsEndpointResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwinsInstance Endpoints. :paramtype next_link: str @@ -802,8 +803,8 @@ def __init__( dead_letter_secret: Optional[str] = None, dead_letter_uri: Optional[str] = None, identity: Optional["_models.ManagedIdentityReference"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -871,8 +872,8 @@ def __init__( *, type: Optional[Union[str, "_models.DigitalTwinsIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of Managed Identity used by the DigitalTwinsInstance. Known values are: "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". @@ -914,8 +915,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.DigitalTwinsIdentity"] = None, properties: Optional["_models.DigitalTwinsPatchProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Instance patch properties. :paramtype tags: dict[str, str] @@ -943,7 +944,9 @@ class DigitalTwinsPatchProperties(_serialization.Model): "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, } - def __init__(self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs): + def __init__( + self, *, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any + ) -> None: """ :keyword public_network_access: Public network access for the DigitalTwinsInstance. Known values are: "Enabled" and "Disabled". @@ -979,7 +982,7 @@ class ErrorDefinition(_serialization.Model): "details": {"key": "details", "type": "[ErrorDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -998,7 +1001,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDefinition"}, } - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: """ :keyword error: Error description. :paramtype error: ~azure.mgmt.digitaltwins.v2022_10_31.models.ErrorDefinition @@ -1077,8 +1080,8 @@ def __init__( dead_letter_uri: Optional[str] = None, identity: Optional["_models.ManagedIdentityReference"] = None, access_key2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1190,8 +1193,8 @@ def __init__( connection_string_secondary_key: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1269,8 +1272,8 @@ def __init__( *, properties: "_models.GroupIdInformationProperties", id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword properties: The group information properties. Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2022_10_31.models.GroupIdInformationProperties @@ -1307,8 +1310,8 @@ def __init__( group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_id: The group id. :paramtype group_id: str @@ -1334,7 +1337,7 @@ class GroupIdInformationResponse(_serialization.Model): "value": {"key": "value", "type": "[GroupIdInformation]"}, } - def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link resources for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2022_10_31.models.GroupIdInformation] @@ -1364,8 +1367,8 @@ def __init__( *, type: Optional[Union[str, "_models.IdentityType"]] = None, user_assigned_identity: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of managed identity used. Known values are: "SystemAssigned" and "UserAssigned". @@ -1411,7 +1414,7 @@ class Operation(_serialization.Model): "properties": {"key": "properties", "type": "{object}"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Operation properties display. :paramtype display: ~azure.mgmt.digitaltwins.v2022_10_31.models.OperationDisplay @@ -1453,7 +1456,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1463,7 +1466,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of DigitalTwins service operations. It contains a list of operations and a URL link to get the next set of results. + """A list of DigitalTwins service operations. It contains a list of operations and a URL link to + get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1483,7 +1487,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, next_link: Optional[str] = None, **kwargs): + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword next_link: The link used to get the next page of DigitalTwins description objects. :paramtype next_link: str @@ -1510,7 +1514,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -1552,7 +1556,7 @@ class PrivateEndpointConnection(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs): + def __init__(self, *, properties: "_models.ConnectionProperties", **kwargs: Any) -> None: """ :keyword properties: The connection properties. Required. :paramtype properties: ~azure.mgmt.digitaltwins.v2022_10_31.models.ConnectionProperties @@ -1576,7 +1580,7 @@ class PrivateEndpointConnectionsResponse(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of available private link connections for a Digital Twin. :paramtype value: list[~azure.mgmt.digitaltwins.v2022_10_31.models.PrivateEndpointConnection] @@ -1660,8 +1664,8 @@ def __init__( secondary_connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword authentication_type: Specifies the authentication type being used for connecting to the endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be @@ -1741,8 +1745,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1802,7 +1806,9 @@ class TimeSeriesDatabaseConnection(ExternalResource): "properties": {"key": "properties", "type": "TimeSeriesDatabaseConnectionProperties"}, } - def __init__(self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.TimeSeriesDatabaseConnectionProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties of a specific time series database connection. :paramtype properties: @@ -1831,8 +1837,8 @@ def __init__( *, next_link: Optional[str] = None, value: Optional[List["_models.TimeSeriesDatabaseConnection"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of results. :paramtype next_link: str @@ -1866,7 +1872,7 @@ class UserAssignedIdentity(_serialization.Model): "principal_id": {"key": "principalId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.client_id = None diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_endpoint_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_endpoint_operations.py index 0bd330f079f4..910e164ca2df 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_endpoint_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_endpoint_operations.py @@ -584,7 +584,7 @@ def begin_create_or_update( :param endpoint_name: Name of Endpoint Resource. Required. :type endpoint_name: str :param endpoint_description: The DigitalTwinsInstance endpoint metadata and security metadata. - Is either a model type or a IO type. Required. + Is either a DigitalTwinsEndpointResource type or a IO type. Required. :type endpoint_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsEndpointResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_operations.py index eb1eb68679fb..95135cd22662 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_digital_twins_operations.py @@ -541,8 +541,8 @@ def begin_create_or_update( :type resource_group_name: str :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str - :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a model - type or a IO type. Required. + :param digital_twins_create: The DigitalTwinsInstance and security metadata. Is either a + DigitalTwinsDescription type or a IO type. Required. :type digital_twins_create: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -774,7 +774,7 @@ def begin_update( :param resource_name: The name of the DigitalTwinsInstance. Required. :type resource_name: str :param digital_twins_patch_description: The DigitalTwinsInstance and security metadata. Is - either a model type or a IO type. Required. + either a DigitalTwinsPatchDescription type or a IO type. Required. :type digital_twins_patch_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.DigitalTwinsPatchDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1203,7 +1203,7 @@ def check_name_availability( :type location: str :param digital_twins_instance_check_name: Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. Is - either a model type or a IO type. Required. + either a CheckNameRequest type or a IO type. Required. :type digital_twins_instance_check_name: ~azure.mgmt.digitaltwins.v2022_10_31.models.CheckNameRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_private_endpoint_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_private_endpoint_connections_operations.py index b9c8abe922eb..2a4c3b3e93a0 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_private_endpoint_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_private_endpoint_connections_operations.py @@ -667,7 +667,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection with updated properties. Is - either a model type or a IO type. Required. + either a PrivateEndpointConnection type or a IO type. Required. :type private_endpoint_connection: ~azure.mgmt.digitaltwins.v2022_10_31.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_time_series_database_connections_operations.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_time_series_database_connections_operations.py index 02182609a0db..2ae17d792f62 100644 --- a/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_time_series_database_connections_operations.py +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/azure/mgmt/digitaltwins/v2022_10_31/operations/_time_series_database_connections_operations.py @@ -596,7 +596,7 @@ def begin_create_or_update( :param time_series_database_connection_name: Name of time series database connection. Required. :type time_series_database_connection_name: str :param time_series_database_connection_description: The time series database connection - description. Is either a model type or a IO type. Required. + description. Is either a TimeSeriesDatabaseConnection type or a IO type. Required. :type time_series_database_connection_description: ~azure.mgmt.digitaltwins.v2022_10_31.models.TimeSeriesDatabaseConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_check_name_availability_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_check_name_availability_example.py new file mode 100644 index 000000000000..619e91cb3d9e --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_check_name_availability_example.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_check_name_availability_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.check_name_availability( + location="WestUS2", + digital_twins_instance_check_name={ + "name": "myadtinstance", + "type": "Microsoft.DigitalTwins/digitalTwinsInstances", + }, + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsCheckNameAvailability_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_example.py new file mode 100644 index 000000000000..04c35176712e --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_delete_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsDelete_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_with_identity_example.py new file mode 100644 index 000000000000..f67ca783738d --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_delete_with_identity_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_delete_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsDelete_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_example.py new file mode 100644 index 000000000000..a297966dbed5 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_delete_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myendpoint", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointDelete_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_with_identity_example.py new file mode 100644 index 000000000000..9d141160c8f2 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_delete_with_identity_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_delete_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myendpoint", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_example.py new file mode 100644 index 000000000000..8dc59c7a11f2 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_get_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myServiceBus", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointGet_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_with_identity_example.py new file mode 100644 index 000000000000..685cc8917f7d --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_get_with_identity_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_get_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myServiceBus", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointGet_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_example.py new file mode 100644 index 000000000000..5e2a82adb363 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_example.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_put_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myServiceBus", + endpoint_description={ + "properties": { + "authenticationType": "KeyBased", + "endpointType": "ServiceBus", + "primaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc", + "secondaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointPut_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_identity_example.py new file mode 100644 index 000000000000..7c68da1361eb --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_identity_example.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_put_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myServiceBus", + endpoint_description={ + "properties": { + "authenticationType": "IdentityBased", + "endpointType": "ServiceBus", + "endpointUri": "sb://mysb.servicebus.windows.net/", + "entityPath": "mysbtopic", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointPut_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_user_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_user_identity_example.py new file mode 100644 index 000000000000..08df93422e70 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoint_put_with_user_identity_example.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoint_put_with_user_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + endpoint_name="myServiceBus", + endpoint_description={ + "properties": { + "authenticationType": "IdentityBased", + "endpointType": "ServiceBus", + "endpointUri": "sb://mysb.servicebus.windows.net/", + "entityPath": "mysbtopic", + "identity": { + "type": "UserAssigned", + "userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointPut_WithUserIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_example.py new file mode 100644 index 000000000000..9c83ad4acf7c --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoints_get_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.list( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointsGet_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_with_identity_example.py new file mode 100644 index 000000000000..5a124ca63f86 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_endpoints_get_with_identity_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_endpoints_get_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins_endpoint.list( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_example.py new file mode 100644 index 000000000000..eee7483fbbce --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_get_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsGet_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_identity_example.py new file mode 100644 index 000000000000..e075bcd3c378 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_identity_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_get_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsGet_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_private_endpoint_connection_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_private_endpoint_connection_example.py new file mode 100644 index 000000000000..cdc5adb37e01 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_get_with_private_endpoint_connection_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_get_with_private_endpoint_connection_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_by_resource_group_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_by_resource_group_example.py new file mode 100644 index 000000000000..b3b7d6e2530a --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_by_resource_group_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_list_by_resource_group_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.list_by_resource_group( + resource_group_name="resRg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsListByResourceGroup_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_example.py new file mode 100644 index 000000000000..74ce35210db2 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_list_example.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_list_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsList_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_operations_list_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_operations_list_example.py new file mode 100644 index 000000000000..ac7283123257 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_operations_list_example.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_operations_list_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsOperationsList_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_example.py new file mode 100644 index 000000000000..0a3b7ebd3650 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_patch_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_patch_description={"tags": {"purpose": "dev"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPatch_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_identity_example.py new file mode 100644 index 000000000000..81315ae4b9ee --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_identity_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_patch_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_patch_description={"identity": {"type": "None"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPatch_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_public_network_access.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_public_network_access.py new file mode 100644 index 000000000000..1e7171407e03 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_patch_with_public_network_access.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_patch_with_public_network_access.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_patch_description={"properties": {"publicNetworkAccess": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_example.py new file mode 100644 index 000000000000..d9ef9b221efd --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_put_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_create={"location": "WestUS2"}, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPut_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_identity_example.py new file mode 100644 index 000000000000..e4396f44c570 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_identity_example.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_put_with_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_create={ + "identity": { + "type": "SystemAssigned,UserAssigned", + "userAssignedIdentities": { + "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {} + }, + }, + "location": "WestUS2", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPut_WithIdentity_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_public_network_access.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_public_network_access.py new file mode 100644 index 000000000000..e067f8691acb --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/digital_twins_put_with_public_network_access.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python digital_twins_put_with_public_network_access.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.digital_twins.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + digital_twins_create={"location": "WestUS2", "properties": {"publicNetworkAccess": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/DigitalTwinsPut_WithPublicNetworkAccess.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_by_connection_name_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_by_connection_name_example.py new file mode 100644 index 000000000000..5b8de9cddbb9 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_by_connection_name_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_endpoint_connection_by_connection_name_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_endpoint_connections.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + private_endpoint_connection_name="myPrivateConnection", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateEndpointConnectionByConnectionName_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_delete_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_delete_example.py new file mode 100644 index 000000000000..b1ecaac985e2 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_delete_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_endpoint_connection_delete_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_endpoint_connections.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + private_endpoint_connection_name="myPrivateConnection", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateEndpointConnectionDelete_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_put_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_put_example.py new file mode 100644 index 000000000000..132e08964911 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connection_put_example.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_endpoint_connection_put_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_endpoint_connections.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + private_endpoint_connection_name="myPrivateConnection", + private_endpoint_connection={ + "properties": { + "privateLinkServiceConnectionState": { + "description": "Approved by johndoe@company.com.", + "status": "Approved", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateEndpointConnectionPut_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connections_list_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connections_list_example.py new file mode 100644 index 000000000000..81bdf8f705eb --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_endpoint_connections_list_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_endpoint_connections_list_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_endpoint_connections.list( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateEndpointConnectionsList_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_by_group_id_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_by_group_id_example.py new file mode 100644 index 000000000000..8c7b8c983ff1 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_by_group_id_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_link_resources_by_group_id_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_link_resources.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + resource_id="subResource", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateLinkResourcesByGroupId_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_list_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_list_example.py new file mode 100644 index 000000000000..1bf84a0dbd4b --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/private_link_resources_list_example.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python private_link_resources_list_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.private_link_resources.list( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/PrivateLinkResourcesList_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_delete_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_delete_example.py new file mode 100644 index 000000000000..0df6cedcb0b8 --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_delete_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python time_series_database_connections_delete_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.time_series_database_connections.begin_delete( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + time_series_database_connection_name="myConnection", + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/TimeSeriesDatabaseConnectionsDelete_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_get_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_get_example.py new file mode 100644 index 000000000000..b2092049624e --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_get_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python time_series_database_connections_get_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.time_series_database_connections.get( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + time_series_database_connection_name="myConnection", + ) + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/TimeSeriesDatabaseConnectionsGet_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_list_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_list_example.py new file mode 100644 index 000000000000..07ac0100918a --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_list_example.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python time_series_database_connections_list_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.time_series_database_connections.list( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/TimeSeriesDatabaseConnectionsList_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_example.py new file mode 100644 index 000000000000..8aee6f517b4a --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_example.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python time_series_database_connections_put_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.time_series_database_connections.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + time_series_database_connection_name="myConnection", + time_series_database_connection_description={ + "properties": { + "adxDatabaseName": "myDatabase", + "adxEndpointUri": "https://mycluster.kusto.windows.net", + "adxResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster", + "adxTableName": "myTable", + "connectionType": "AzureDataExplorer", + "eventHubEndpointUri": "sb://myeh.servicebus.windows.net/", + "eventHubEntityPath": "myeh", + "eventHubNamespaceResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/TimeSeriesDatabaseConnectionsPut_example.json +if __name__ == "__main__": + main() diff --git a/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_with_user_identity_example.py b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_with_user_identity_example.py new file mode 100644 index 000000000000..24380df4a51d --- /dev/null +++ b/sdk/digitaltwins/azure-mgmt-digitaltwins/generated_samples/time_series_database_connections_put_with_user_identity_example.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-digitaltwins +# USAGE + python time_series_database_connections_put_with_user_identity_example.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureDigitalTwinsManagementClient( + credential=DefaultAzureCredential(), + subscription_id="50016170-c839-41ba-a724-51e9df440b9e", + ) + + response = client.time_series_database_connections.begin_create_or_update( + resource_group_name="resRg", + resource_name="myDigitalTwinsService", + time_series_database_connection_name="myConnection", + time_series_database_connection_description={ + "properties": { + "adxDatabaseName": "myDatabase", + "adxEndpointUri": "https://mycluster.kusto.windows.net", + "adxResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster", + "adxTableName": "myTable", + "connectionType": "AzureDataExplorer", + "eventHubEndpointUri": "sb://myeh.servicebus.windows.net/", + "eventHubEntityPath": "myeh", + "eventHubNamespaceResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh", + "identity": { + "type": "UserAssigned", + "userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-10-31/examples/TimeSeriesDatabaseConnectionsPut_WithUserIdentity_example.json +if __name__ == "__main__": + main()