From 8bbb37d9344b64ca57b7241204ab3ad3a4a19089 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 27 Feb 2025 07:08:43 +0000 Subject: [PATCH] CodeGen from PR 32741 in Azure/azure-rest-api-specs Merge e64756157328c1d3837acd37bf82342874372d9b into c2afa6e1f7ced1b3c1fdd3518a9d49b44871d7a7 --- .../azure-mgmt-mongocluster/_meta.json | 4 +- .../apiview-properties.json | 80 ++++ .../azure/mgmt/mongocluster/__init__.py | 12 +- .../azure/mgmt/mongocluster/_client.py | 8 +- .../azure/mgmt/mongocluster/_configuration.py | 10 +- .../azure/mgmt/mongocluster/_model_base.py | 99 +++- .../azure/mgmt/mongocluster/_serialization.py | 173 +++---- .../azure/mgmt/mongocluster/_version.py | 2 +- .../azure/mgmt/mongocluster/aio/__init__.py | 12 +- .../azure/mgmt/mongocluster/aio/_client.py | 8 +- .../mgmt/mongocluster/aio/_configuration.py | 10 +- .../mongocluster/aio/operations/__init__.py | 22 +- .../aio/operations/_operations.py | 153 +++--- .../mgmt/mongocluster/models/__init__.py | 125 ++--- .../azure/mgmt/mongocluster/models/_enums.py | 9 + .../azure/mgmt/mongocluster/models/_models.py | 444 ++++++++++++------ .../mgmt/mongocluster/operations/__init__.py | 22 +- .../mongocluster/operations/_operations.py | 214 ++++----- .../mongo_clusters_create.py | 2 +- .../mongo_clusters_create_geo_replica.py | 3 +- .../mongo_clusters_create_pitr.py | 3 +- .../mongo_clusters_delete.py | 2 +- .../mongo_clusters_firewall_rule_create.py | 2 +- .../mongo_clusters_firewall_rule_delete.py | 2 +- .../mongo_clusters_firewall_rule_get.py | 2 +- .../mongo_clusters_firewall_rule_list.py | 2 +- .../mongo_clusters_force_promote_replica.py | 2 +- .../generated_samples/mongo_clusters_get.py | 2 +- .../generated_samples/mongo_clusters_list.py | 2 +- .../mongo_clusters_list_by_resource_group.py | 2 +- .../mongo_clusters_list_connection_strings.py | 2 +- .../mongo_clusters_name_availability.py | 2 +- ...usters_name_availability_already_exists.py | 2 +- .../mongo_clusters_patch_data_api.py | 43 ++ .../mongo_clusters_patch_disk_size.py | 2 +- ...o_clusters_patch_private_network_access.py | 2 +- ...ters_private_endpoint_connection_delete.py | 2 +- ...lusters_private_endpoint_connection_get.py | 2 +- ...usters_private_endpoint_connection_list.py | 2 +- ...lusters_private_endpoint_connection_put.py | 2 +- ...ngo_clusters_private_link_resource_list.py | 2 +- .../mongo_clusters_replica_list.py | 2 +- .../mongo_clusters_reset_password.py | 2 +- .../mongo_clusters_update.py | 2 +- .../generated_samples/operations_list.py | 2 +- ..._cluster_mgmt_mongo_clusters_operations.py | 2 + ...er_mgmt_mongo_clusters_operations_async.py | 2 + .../test_cli_mgmt_mongocluster_lro_test.py | 3 +- .../azure-mgmt-mongocluster/tsp-location.yaml | 2 +- 49 files changed, 915 insertions(+), 598 deletions(-) create mode 100644 sdk/mongocluster/azure-mgmt-mongocluster/apiview-properties.json create mode 100644 sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_data_api.py diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/_meta.json b/sdk/mongocluster/azure-mgmt-mongocluster/_meta.json index c03f8a84580e..e7d7ddad300a 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/_meta.json +++ b/sdk/mongocluster/azure-mgmt-mongocluster/_meta.json @@ -1,6 +1,6 @@ { - "commit": "f93850874010501f216ceadf19459402efd16d9e", + "commit": "fbb413f68a8ca8acf5f03ac50fbf54a63cf1d716", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/mongocluster/DocumentDB.MongoCluster.Management", - "@azure-tools/typespec-python": "0.33.0" + "@azure-tools/typespec-python": "0.38.4" } \ No newline at end of file diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/apiview-properties.json b/sdk/mongocluster/azure-mgmt-mongocluster/apiview-properties.json new file mode 100644 index 000000000000..6e37ddeaa2dc --- /dev/null +++ b/sdk/mongocluster/azure-mgmt-mongocluster/apiview-properties.json @@ -0,0 +1,80 @@ +{ + "CrossLanguagePackageId": "Microsoft.DocumentDB", + "CrossLanguageDefinitionId": { + "azure.mgmt.mongocluster.models.AdministratorProperties": "Microsoft.DocumentDB.AdministratorProperties", + "azure.mgmt.mongocluster.models.BackupProperties": "Microsoft.DocumentDB.BackupProperties", + "azure.mgmt.mongocluster.models.CheckNameAvailabilityRequest": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest", + "azure.mgmt.mongocluster.models.CheckNameAvailabilityResponse": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse", + "azure.mgmt.mongocluster.models.ComputeProperties": "Microsoft.DocumentDB.ComputeProperties", + "azure.mgmt.mongocluster.models.ConnectionString": "Microsoft.DocumentDB.ConnectionString", + "azure.mgmt.mongocluster.models.DataApiProperties": "Microsoft.DocumentDB.DataApiProperties", + "azure.mgmt.mongocluster.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.mongocluster.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.mongocluster.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.mongocluster.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.mongocluster.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.mongocluster.models.FirewallRule": "Microsoft.DocumentDB.FirewallRule", + "azure.mgmt.mongocluster.models.FirewallRuleProperties": "Microsoft.DocumentDB.FirewallRuleProperties", + "azure.mgmt.mongocluster.models.HighAvailabilityProperties": "Microsoft.DocumentDB.HighAvailabilityProperties", + "azure.mgmt.mongocluster.models.ListConnectionStringsResult": "Microsoft.DocumentDB.ListConnectionStringsResult", + "azure.mgmt.mongocluster.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.mongocluster.models.MongoCluster": "Microsoft.DocumentDB.MongoCluster", + "azure.mgmt.mongocluster.models.MongoClusterProperties": "Microsoft.DocumentDB.MongoClusterProperties", + "azure.mgmt.mongocluster.models.MongoClusterReplicaParameters": "Microsoft.DocumentDB.MongoClusterReplicaParameters", + "azure.mgmt.mongocluster.models.MongoClusterRestoreParameters": "Microsoft.DocumentDB.MongoClusterRestoreParameters", + "azure.mgmt.mongocluster.models.MongoClusterUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.mongocluster.models.MongoClusterUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.mongocluster.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.mongocluster.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.mongocluster.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", + "azure.mgmt.mongocluster.models.PrivateEndpointConnection": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnection", + "azure.mgmt.mongocluster.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", + "azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource": "Microsoft.DocumentDB.PrivateEndpointConnectionResource", + "azure.mgmt.mongocluster.models.PrivateLinkResource": "Microsoft.DocumentDB.PrivateLinkResource", + "azure.mgmt.mongocluster.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", + "azure.mgmt.mongocluster.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "azure.mgmt.mongocluster.models.PromoteReplicaRequest": "Microsoft.DocumentDB.PromoteReplicaRequest", + "azure.mgmt.mongocluster.models.Replica": "Microsoft.DocumentDB.Replica", + "azure.mgmt.mongocluster.models.ReplicationProperties": "Microsoft.DocumentDB.ReplicationProperties", + "azure.mgmt.mongocluster.models.ShardingProperties": "Microsoft.DocumentDB.ShardingProperties", + "azure.mgmt.mongocluster.models.StorageProperties": "Microsoft.DocumentDB.StorageProperties", + "azure.mgmt.mongocluster.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.mongocluster.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.mongocluster.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.mongocluster.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.mongocluster.models.CreateMode": "Microsoft.DocumentDB.CreateMode", + "azure.mgmt.mongocluster.models.ProvisioningState": "Microsoft.DocumentDB.ProvisioningState", + "azure.mgmt.mongocluster.models.MongoClusterStatus": "Microsoft.DocumentDB.MongoClusterStatus", + "azure.mgmt.mongocluster.models.PublicNetworkAccess": "Microsoft.DocumentDB.PublicNetworkAccess", + "azure.mgmt.mongocluster.models.HighAvailabilityMode": "Microsoft.DocumentDB.HighAvailabilityMode", + "azure.mgmt.mongocluster.models.DataApiMode": "Microsoft.DocumentDB.DataApiMode", + "azure.mgmt.mongocluster.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", + "azure.mgmt.mongocluster.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.mongocluster.models.PreviewFeature": "Microsoft.DocumentDB.PreviewFeature", + "azure.mgmt.mongocluster.models.ReplicationRole": "Microsoft.DocumentDB.ReplicationRole", + "azure.mgmt.mongocluster.models.ReplicationState": "Microsoft.DocumentDB.ReplicationState", + "azure.mgmt.mongocluster.models.CheckNameAvailabilityReason": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason", + "azure.mgmt.mongocluster.models.PromoteOption": "Microsoft.DocumentDB.PromoteOption", + "azure.mgmt.mongocluster.models.PromoteMode": "Microsoft.DocumentDB.PromoteMode", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.get": "Microsoft.DocumentDB.MongoClusters.get", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.begin_create_or_update": "Microsoft.DocumentDB.MongoClusters.createOrUpdate", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.begin_update": "Microsoft.DocumentDB.MongoClusters.update", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.begin_delete": "Microsoft.DocumentDB.MongoClusters.delete", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.list_by_resource_group": "Microsoft.DocumentDB.MongoClusters.listByResourceGroup", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.list": "Microsoft.DocumentDB.MongoClusters.list", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.list_connection_strings": "Microsoft.DocumentDB.MongoClusters.listConnectionStrings", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.check_name_availability": "Microsoft.DocumentDB.MongoClusters.checkNameAvailability", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.mongo_clusters.begin_promote": "Microsoft.DocumentDB.MongoClusters.promote", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.firewall_rules.get": "Microsoft.DocumentDB.FirewallRules.get", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.firewall_rules.begin_create_or_update": "Microsoft.DocumentDB.FirewallRules.createOrUpdate", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.firewall_rules.begin_delete": "Microsoft.DocumentDB.FirewallRules.delete", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.firewall_rules.list_by_mongo_cluster": "Microsoft.DocumentDB.FirewallRules.listByMongoCluster", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.private_endpoint_connections.list_by_mongo_cluster": "Microsoft.DocumentDB.PrivateEndpointConnections.listByMongoCluster", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.private_endpoint_connections.get": "Microsoft.DocumentDB.PrivateEndpointConnections.get", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.private_endpoint_connections.begin_create": "Microsoft.DocumentDB.PrivateEndpointConnections.create", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.private_endpoint_connections.begin_delete": "Microsoft.DocumentDB.PrivateEndpointConnections.delete", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.private_links.list_by_mongo_cluster": "Microsoft.DocumentDB.PrivateLinks.listByMongoCluster", + "azure.mgmt.mongocluster.MongoClusterMgmtClient.replicas.list_by_parent": "Microsoft.DocumentDB.Replicas.listByParent" + } +} \ No newline at end of file diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/__init__.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/__init__.py index 7c7f589084c0..034de13c93e8 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/__init__.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import MongoClusterMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import MongoClusterMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "MongoClusterMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py index 93fcfbef2c23..ea9ccd522f24 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class MongoClusterMgmtClient: """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for MongoDB vCore resources including clusters and firewall rules. @@ -54,8 +53,9 @@ class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-07-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2024-10-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py index 870c54669cad..377040c8207e 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for MongoClusterMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,8 +29,9 @@ class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance- :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-07-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2024-10-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -42,7 +42,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-07-01") + api_version: str = kwargs.pop("api_version", "2024-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_model_base.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_model_base.py index 12ad7f29c71e..3072ee252ed9 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_model_base.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_model_base.py @@ -1,10 +1,11 @@ +# pylint: disable=too-many-lines # 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. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -372,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ return self._data.items() def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ try: return self[key] except KeyError: @@ -396,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ... def pop(self, key: str, default: typing.Any) -> typing.Any: ... def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload @@ -416,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ... def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -573,7 +621,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -584,8 +632,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -600,8 +648,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -612,7 +660,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -632,11 +680,11 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -733,7 +781,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -753,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -893,6 +941,35 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_serialization.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_serialization.py index 01a226bd7f14..e2a20b1d534c 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_serialization.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_serialization.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,9 +48,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -61,13 +59,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -185,73 +183,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -480,7 +412,7 @@ def from_dict( :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong - :rtype: ModelType + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -507,7 +439,6 @@ def _flatten_subtype(cls, key, objects): def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. :param dict response: The initial data :param dict objects: The class objects @@ -519,7 +450,7 @@ def _classify(cls, response, objects): if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -564,7 +495,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -599,7 +530,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -627,7 +558,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -737,8 +668,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -782,8 +713,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -806,8 +737,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -836,8 +767,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -856,9 +787,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1193,7 +1124,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1219,7 +1150,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1252,7 +1183,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1430,7 +1361,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1442,7 +1373,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1453,7 +1384,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1489,7 +1420,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1503,7 +1434,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1684,17 +1615,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore @@ -1714,7 +1649,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1796,7 +1731,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1842,7 +1777,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1933,7 +1868,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1946,7 +1881,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1961,7 +1896,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1979,7 +1914,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1992,7 +1927,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2010,7 +1945,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2026,7 +1961,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2041,14 +1976,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2064,7 +1999,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2102,7 +2037,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_version.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_version.py index 0ec13ea52bbf..be71c81bd282 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_version.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/__init__.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/__init__.py index 450287ccbf62..1d6e3fc2ed37 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/__init__.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import MongoClusterMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import MongoClusterMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "MongoClusterMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_client.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_client.py index 837664327c15..af56d2db071e 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_client.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_client.py @@ -27,11 +27,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyword +class MongoClusterMgmtClient: """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for MongoDB vCore resources including clusters and firewall rules. @@ -54,8 +53,9 @@ class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-07-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2024-10-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_configuration.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_configuration.py index fefa880a1456..c55c69890203 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_configuration.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for MongoClusterMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -30,8 +29,9 @@ class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance- :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-07-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2024-10-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -42,7 +42,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-07-01") + api_version: str = kwargs.pop("api_version", "2024-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/__init__.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/__init__.py index c2fa532ddd59..75f58de4243d 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/__init__.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import MongoClustersOperations -from ._operations import FirewallRulesOperations -from ._operations import PrivateEndpointConnectionsOperations -from ._operations import PrivateLinksOperations -from ._operations import ReplicasOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import MongoClustersOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinksOperations # type: ignore +from ._operations import ReplicasOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -25,5 +31,5 @@ "PrivateLinksOperations", "ReplicasOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/_operations.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/_operations.py index 4a0bf928072d..d950bb94528b 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/_operations.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,23 +9,10 @@ from io import IOBase import json import sys -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - List, - Optional, - Type, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -47,7 +34,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer from ..._validation import api_version_validation from ...operations._operations import ( build_firewall_rules_create_or_update_request, @@ -71,11 +59,12 @@ build_private_links_list_by_mongo_cluster_request, build_replicas_list_by_parent_request, ) +from .._configuration import MongoClusterMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -93,10 +82,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -114,7 +103,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +166,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -197,10 +186,10 @@ class MongoClustersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async @api_version_validation( @@ -218,7 +207,7 @@ async def get(self, resource_group_name: str, mongo_cluster_name: str, **kwargs: :rtype: ~azure.mgmt.mongocluster.models.MongoCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +247,7 @@ async def get(self, resource_group_name: str, mongo_cluster_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -281,7 +270,7 @@ async def _create_or_update_initial( resource: Union[_models.MongoCluster, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +319,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -520,7 +509,7 @@ async def _update_initial( properties: Union[_models.MongoClusterUpdate, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -569,7 +558,7 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -756,7 +745,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -795,7 +784,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -891,7 +880,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy cls: ClsType[List[_models.MongoCluster]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -956,7 +945,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -979,7 +968,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.MongoCluster"]: cls: ClsType[List[_models.MongoCluster]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1043,7 +1032,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1070,7 +1059,7 @@ async def list_connection_strings( :rtype: ~azure.mgmt.mongocluster.models.ListConnectionStringsResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1110,7 +1099,7 @@ async def list_connection_strings( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1204,7 +1193,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.mongocluster.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1253,7 +1242,7 @@ async def check_name_availability( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1287,7 +1276,7 @@ async def _promote_initial( body: Union[_models.PromoteReplicaRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1325,7 @@ async def _promote_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1527,10 +1516,10 @@ class FirewallRulesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async @api_version_validation( @@ -1552,7 +1541,7 @@ async def get( :rtype: ~azure.mgmt.mongocluster.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1593,7 +1582,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1617,7 +1606,7 @@ async def _create_or_update_initial( resource: Union[_models.FirewallRule, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1667,7 +1656,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1863,7 +1852,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, mongo_cluster_name: str, firewall_rule_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1903,7 +1892,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2006,7 +1995,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2072,7 +2061,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2092,10 +2081,10 @@ class PrivateEndpointConnectionsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -2121,7 +2110,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2187,7 +2176,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2216,7 +2205,7 @@ async def get( :rtype: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2257,7 +2246,7 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2281,7 +2270,7 @@ async def _create_initial( resource: Union[_models.PrivateEndpointConnectionResource, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2331,7 +2320,7 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2540,7 +2529,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2580,7 +2569,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2674,10 +2663,10 @@ class PrivateLinksOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -2703,7 +2692,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2769,7 +2758,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2789,10 +2778,10 @@ class ReplicasOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -2827,7 +2816,7 @@ def list_by_parent( cls: ClsType[List[_models.Replica]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2893,7 +2882,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/__init__.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/__init__.py index a352c3476837..9f421811c5f1 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/__init__.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/__init__.py @@ -5,63 +5,76 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import AdministratorProperties -from ._models import BackupProperties -from ._models import CheckNameAvailabilityRequest -from ._models import CheckNameAvailabilityResponse -from ._models import ComputeProperties -from ._models import ConnectionString -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import FirewallRule -from ._models import FirewallRuleProperties -from ._models import HighAvailabilityProperties -from ._models import ListConnectionStringsResult -from ._models import MongoCluster -from ._models import MongoClusterProperties -from ._models import MongoClusterReplicaParameters -from ._models import MongoClusterRestoreParameters -from ._models import MongoClusterUpdate -from ._models import MongoClusterUpdateProperties -from ._models import Operation -from ._models import OperationDisplay -from ._models import PrivateEndpoint -from ._models import PrivateEndpointConnection -from ._models import PrivateEndpointConnectionProperties -from ._models import PrivateEndpointConnectionResource -from ._models import PrivateLinkResource -from ._models import PrivateLinkResourceProperties -from ._models import PrivateLinkServiceConnectionState -from ._models import PromoteReplicaRequest -from ._models import ProxyResource -from ._models import Replica -from ._models import ReplicationProperties -from ._models import Resource -from ._models import ShardingProperties -from ._models import StorageProperties -from ._models import SystemData -from ._models import TrackedResource +from typing import TYPE_CHECKING -from ._enums import ActionType -from ._enums import CheckNameAvailabilityReason -from ._enums import CreateMode -from ._enums import CreatedByType -from ._enums import HighAvailabilityMode -from ._enums import MongoClusterStatus -from ._enums import Origin -from ._enums import PreviewFeature -from ._enums import PrivateEndpointConnectionProvisioningState -from ._enums import PrivateEndpointServiceConnectionStatus -from ._enums import PromoteMode -from ._enums import PromoteOption -from ._enums import ProvisioningState -from ._enums import PublicNetworkAccess -from ._enums import ReplicationRole -from ._enums import ReplicationState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AdministratorProperties, + BackupProperties, + CheckNameAvailabilityRequest, + CheckNameAvailabilityResponse, + ComputeProperties, + ConnectionString, + DataApiProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + FirewallRule, + FirewallRuleProperties, + HighAvailabilityProperties, + ListConnectionStringsResult, + MongoCluster, + MongoClusterProperties, + MongoClusterReplicaParameters, + MongoClusterRestoreParameters, + MongoClusterUpdate, + MongoClusterUpdateProperties, + Operation, + OperationDisplay, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpointConnectionResource, + PrivateLinkResource, + PrivateLinkResourceProperties, + PrivateLinkServiceConnectionState, + PromoteReplicaRequest, + ProxyResource, + Replica, + ReplicationProperties, + Resource, + ShardingProperties, + StorageProperties, + SystemData, + TrackedResource, +) + +from ._enums import ( # type: ignore + ActionType, + CheckNameAvailabilityReason, + CreateMode, + CreatedByType, + DataApiMode, + HighAvailabilityMode, + MongoClusterStatus, + Origin, + PreviewFeature, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + PromoteMode, + PromoteOption, + ProvisioningState, + PublicNetworkAccess, + ReplicationRole, + ReplicationState, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -71,6 +84,7 @@ "CheckNameAvailabilityResponse", "ComputeProperties", "ConnectionString", + "DataApiProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -106,6 +120,7 @@ "CheckNameAvailabilityReason", "CreateMode", "CreatedByType", + "DataApiMode", "HighAvailabilityMode", "MongoClusterStatus", "Origin", @@ -119,5 +134,5 @@ "ReplicationRole", "ReplicationState", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_enums.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_enums.py index 850548c02ab8..589e40fda2c5 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_enums.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_enums.py @@ -54,6 +54,15 @@ class CreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Create a replica cluster in the same geographic region as the source cluster.""" +class DataApiMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode to apply to the Mongo Data API.""" + + ENABLED = "Enabled" + """Mongo Data API is enabled for the cluster.""" + DISABLED = "Disabled" + """Mongo Data API is disabled for the cluster.""" + + class HighAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The high availability modes for a cluster.""" diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_models.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_models.py index 6558dd01704b..002642b3dec2 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_models.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/models/_models.py @@ -1,11 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # 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) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -14,7 +15,6 @@ from .._model_base import rest_field if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -38,16 +38,16 @@ def __init__( *, user_name: Optional[str] = None, password: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -74,9 +74,9 @@ class CheckNameAvailabilityRequest(_model_base.Model): :vartype type: str """ - name: Optional[str] = rest_field() + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the resource for which availability needs to be checked.""" - type: Optional[str] = rest_field() + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The resource type.""" @overload @@ -85,16 +85,16 @@ def __init__( *, name: Optional[str] = None, type: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -110,12 +110,16 @@ class CheckNameAvailabilityResponse(_model_base.Model): :vartype message: str """ - name_available: Optional[bool] = rest_field(name="nameAvailable") + name_available: Optional[bool] = rest_field( + name="nameAvailable", visibility=["read", "create", "update", "delete", "query"] + ) """Indicates if the resource name is available.""" - reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = rest_field() + reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The reason why the given name is not available. Known values are: \"Invalid\" and \"AlreadyExists\".""" - message: Optional[str] = rest_field() + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Detailed reason why the given name is not available.""" @overload @@ -125,16 +129,16 @@ def __init__( name_available: Optional[bool] = None, reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None, message: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -147,7 +151,7 @@ class ComputeProperties(_model_base.Model): :vartype tier: str """ - tier: Optional[str] = rest_field() + tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example values: 'M30', 'M40'.""" @@ -156,16 +160,16 @@ def __init__( self, *, tier: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -190,6 +194,38 @@ class ConnectionString(_model_base.Model): """Name of the connection string.""" +class DataApiProperties(_model_base.Model): + """Data API properties. + + :ivar mode: The mode to indicate whether the Mongo Data API is enabled for a cluster. Known + values are: "Enabled" and "Disabled". + :vartype mode: str or ~azure.mgmt.mongocluster.models.DataApiMode + """ + + mode: Optional[Union[str, "_models.DataApiMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The mode to indicate whether the Mongo Data API is enabled for a cluster. Known values are: + \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, "_models.DataApiMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class ErrorAdditionalInfo(_model_base.Model): """The resource management error additional info. @@ -246,7 +282,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.mongocluster.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -254,16 +290,16 @@ def __init__( self, *, error: Optional["_models.ErrorDetail"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -273,7 +309,7 @@ class Resource(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -287,7 +323,7 @@ class Resource(_model_base.Model): id: Optional[str] = rest_field(visibility=["read"]) """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" name: Optional[str] = rest_field(visibility=["read"]) """The name of the resource.""" type: Optional[str] = rest_field(visibility=["read"]) @@ -304,7 +340,7 @@ class ProxyResource(Resource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -323,7 +359,7 @@ class FirewallRule(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -337,7 +373,9 @@ class FirewallRule(ProxyResource): :vartype properties: ~azure.mgmt.mongocluster.models.FirewallRuleProperties """ - properties: Optional["_models.FirewallRuleProperties"] = rest_field() + properties: Optional["_models.FirewallRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -345,16 +383,16 @@ def __init__( self, *, properties: Optional["_models.FirewallRuleProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -380,9 +418,11 @@ class FirewallRuleProperties(_model_base.Model): ) """The provisioning state of the firewall rule. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"InProgress\", \"Updating\", and \"Dropping\".""" - start_ip_address: str = rest_field(name="startIpAddress") + start_ip_address: str = rest_field( + name="startIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) """The start IP address of the mongo cluster firewall rule. Must be IPv4 format. Required.""" - end_ip_address: str = rest_field(name="endIpAddress") + end_ip_address: str = rest_field(name="endIpAddress", visibility=["read", "create", "update", "delete", "query"]) """The end IP address of the mongo cluster firewall rule. Must be IPv4 format. Required.""" @overload @@ -391,16 +431,16 @@ def __init__( *, start_ip_address: str, end_ip_address: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -412,7 +452,9 @@ class HighAvailabilityProperties(_model_base.Model): :vartype target_mode: str or ~azure.mgmt.mongocluster.models.HighAvailabilityMode """ - target_mode: Optional[Union[str, "_models.HighAvailabilityMode"]] = rest_field(name="targetMode") + target_mode: Optional[Union[str, "_models.HighAvailabilityMode"]] = rest_field( + name="targetMode", visibility=["read", "create", "update", "delete", "query"] + ) """The target high availability mode requested for the cluster. Known values are: \"Disabled\", \"SameZone\", and \"ZoneRedundantPreferred\".""" @@ -421,16 +463,16 @@ def __init__( self, *, target_mode: Optional[Union[str, "_models.HighAvailabilityMode"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -457,7 +499,7 @@ class TrackedResource(Resource): :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -473,7 +515,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -484,16 +526,16 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -504,7 +546,7 @@ class MongoCluster(TrackedResource): :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -522,7 +564,9 @@ class MongoCluster(TrackedResource): :vartype properties: ~azure.mgmt.mongocluster.models.MongoClusterProperties """ - properties: Optional["_models.MongoClusterProperties"] = rest_field() + properties: Optional["_models.MongoClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -532,20 +576,20 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.MongoClusterProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MongoClusterProperties(_model_base.Model): # pylint: disable=too-many-instance-attributes +class MongoClusterProperties(_model_base.Model): """The properties of a mongo cluster. Readonly variables are only populated by the server, and will be ignored when sending a request. @@ -583,6 +627,8 @@ class MongoClusterProperties(_model_base.Model): # pylint: disable=too-many-ins :vartype compute: ~azure.mgmt.mongocluster.models.ComputeProperties :ivar backup: The backup properties of the mongo cluster. :vartype backup: ~azure.mgmt.mongocluster.models.BackupProperties + :ivar data_api: The Data API properties of the mongo cluster. + :vartype data_api: ~azure.mgmt.mongocluster.models.DataApiProperties :ivar private_endpoint_connections: List of private endpoint connections. :vartype private_endpoint_connections: list[~azure.mgmt.mongocluster.models.PrivateEndpointConnection] @@ -605,9 +651,13 @@ class MongoClusterProperties(_model_base.Model): # pylint: disable=too-many-ins name="replicaParameters", visibility=["create"] ) """The parameters to create a replica mongo cluster.""" - administrator: Optional["_models.AdministratorProperties"] = rest_field() + administrator: Optional["_models.AdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The local administrator properties for the mongo cluster.""" - server_version: Optional[str] = rest_field(name="serverVersion") + server_version: Optional[str] = rest_field( + name="serverVersion", visibility=["read", "create", "update", "delete", "query"] + ) """The Mongo DB server version. Defaults to the latest available version if not specified.""" connection_string: Optional[str] = rest_field(name="connectionString", visibility=["read"]) """The default mongo connection string for the cluster.""" @@ -621,24 +671,42 @@ class MongoClusterProperties(_model_base.Model): # pylint: disable=too-many-ins ) """The status of the mongo cluster. Known values are: \"Ready\", \"Provisioning\", \"Updating\", \"Starting\", \"Stopping\", \"Stopped\", and \"Dropping\".""" - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(name="publicNetworkAccess") + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field( + name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) """Whether or not public endpoint access is allowed for this mongo cluster. Known values are: \"Enabled\" and \"Disabled\".""" - high_availability: Optional["_models.HighAvailabilityProperties"] = rest_field(name="highAvailability") + high_availability: Optional["_models.HighAvailabilityProperties"] = rest_field( + name="highAvailability", visibility=["read", "create", "update", "delete", "query"] + ) """The high availability properties of the mongo cluster.""" - storage: Optional["_models.StorageProperties"] = rest_field() + storage: Optional["_models.StorageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The storage properties of the mongo cluster.""" - sharding: Optional["_models.ShardingProperties"] = rest_field() + sharding: Optional["_models.ShardingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The sharding properties of the mongo cluster.""" - compute: Optional["_models.ComputeProperties"] = rest_field() + compute: Optional["_models.ComputeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The compute properties of the mongo cluster.""" - backup: Optional["_models.BackupProperties"] = rest_field() + backup: Optional["_models.BackupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The backup properties of the mongo cluster.""" + data_api: Optional["_models.DataApiProperties"] = rest_field( + name="dataApi", visibility=["read", "create", "update", "delete", "query"] + ) + """The Data API properties of the mongo cluster.""" private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = rest_field( name="privateEndpointConnections", visibility=["read"] ) """List of private endpoint connections.""" - preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = rest_field(name="previewFeatures") + preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = rest_field( + name="previewFeatures", visibility=["read", "create", "update", "delete", "query"] + ) """List of private endpoint connections.""" replica: Optional["_models.ReplicationProperties"] = rest_field(visibility=["read"]) """The replication properties for the mongo cluster.""" @@ -660,17 +728,18 @@ def __init__( sharding: Optional["_models.ShardingProperties"] = None, compute: Optional["_models.ComputeProperties"] = None, backup: Optional["_models.BackupProperties"] = None, + data_api: Optional["_models.DataApiProperties"] = None, preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -684,9 +753,11 @@ class MongoClusterReplicaParameters(_model_base.Model): :vartype source_location: str """ - source_resource_id: str = rest_field(name="sourceResourceId") + source_resource_id: str = rest_field( + name="sourceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """The id of the replication source cluster. Required.""" - source_location: str = rest_field(name="sourceLocation") + source_location: str = rest_field(name="sourceLocation", visibility=["read", "create", "update", "delete", "query"]) """The location of the source cluster. Required.""" @overload @@ -695,16 +766,16 @@ def __init__( *, source_resource_id: str, source_location: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -717,9 +788,13 @@ class MongoClusterRestoreParameters(_model_base.Model): :vartype source_resource_id: str """ - point_in_time_utc: Optional[datetime.datetime] = rest_field(name="pointInTimeUTC", format="rfc3339") + point_in_time_utc: Optional[datetime.datetime] = rest_field( + name="pointInTimeUTC", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """UTC point in time to restore a mongo cluster.""" - source_resource_id: Optional[str] = rest_field(name="sourceResourceId") + source_resource_id: Optional[str] = rest_field( + name="sourceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """Resource ID to locate the source cluster to restore.""" @overload @@ -728,16 +803,16 @@ def __init__( *, point_in_time_utc: Optional[datetime.datetime] = None, source_resource_id: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -750,9 +825,11 @@ class MongoClusterUpdate(_model_base.Model): :vartype properties: ~azure.mgmt.mongocluster.models.MongoClusterUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.MongoClusterUpdateProperties"] = rest_field() + properties: Optional["_models.MongoClusterUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -761,16 +838,16 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.MongoClusterUpdateProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -795,28 +872,52 @@ class MongoClusterUpdateProperties(_model_base.Model): :vartype compute: ~azure.mgmt.mongocluster.models.ComputeProperties :ivar backup: The backup properties of the mongo cluster. :vartype backup: ~azure.mgmt.mongocluster.models.BackupProperties + :ivar data_api: The Data API properties of the mongo cluster. + :vartype data_api: ~azure.mgmt.mongocluster.models.DataApiProperties :ivar preview_features: List of private endpoint connections. :vartype preview_features: list[str or ~azure.mgmt.mongocluster.models.PreviewFeature] """ - administrator: Optional["_models.AdministratorProperties"] = rest_field() + administrator: Optional["_models.AdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The local administrator properties for the mongo cluster.""" - server_version: Optional[str] = rest_field(name="serverVersion") + server_version: Optional[str] = rest_field( + name="serverVersion", visibility=["read", "create", "update", "delete", "query"] + ) """The Mongo DB server version. Defaults to the latest available version if not specified.""" - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(name="publicNetworkAccess") + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field( + name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) """Whether or not public endpoint access is allowed for this mongo cluster. Known values are: \"Enabled\" and \"Disabled\".""" - high_availability: Optional["_models.HighAvailabilityProperties"] = rest_field(name="highAvailability") + high_availability: Optional["_models.HighAvailabilityProperties"] = rest_field( + name="highAvailability", visibility=["read", "create", "update", "delete", "query"] + ) """The high availability properties of the mongo cluster.""" - storage: Optional["_models.StorageProperties"] = rest_field() + storage: Optional["_models.StorageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The storage properties of the mongo cluster.""" - sharding: Optional["_models.ShardingProperties"] = rest_field() + sharding: Optional["_models.ShardingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The sharding properties of the mongo cluster.""" - compute: Optional["_models.ComputeProperties"] = rest_field() + compute: Optional["_models.ComputeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The compute properties of the mongo cluster.""" - backup: Optional["_models.BackupProperties"] = rest_field() + backup: Optional["_models.BackupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The backup properties of the mongo cluster.""" - preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = rest_field(name="previewFeatures") + data_api: Optional["_models.DataApiProperties"] = rest_field( + name="dataApi", visibility=["read", "create", "update", "delete", "query"] + ) + """The Data API properties of the mongo cluster.""" + preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = rest_field( + name="previewFeatures", visibility=["read", "create", "update", "delete", "query"] + ) """List of private endpoint connections.""" @overload @@ -831,17 +932,18 @@ def __init__( sharding: Optional["_models.ShardingProperties"] = None, compute: Optional["_models.ComputeProperties"] = None, backup: Optional["_models.BackupProperties"] = None, + data_api: Optional["_models.DataApiProperties"] = None, preview_features: Optional[List[Union[str, "_models.PreviewFeature"]]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -874,13 +976,15 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" @@ -888,17 +992,17 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, - ): ... + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -954,7 +1058,7 @@ class PrivateEndpointConnection(Resource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -968,7 +1072,9 @@ class PrivateEndpointConnection(Resource): :vartype properties: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionProperties """ - properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field() + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The private endpoint connection properties.""" @overload @@ -976,16 +1082,16 @@ def __init__( self, *, properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1011,10 +1117,12 @@ class PrivateEndpointConnectionProperties(_model_base.Model): group_ids: Optional[List[str]] = rest_field(name="groupIds", visibility=["read"]) """The group ids for the private endpoint resource.""" - private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field(name="privateEndpoint") + private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field( + name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) """The private endpoint resource.""" private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field( - name="privateLinkServiceConnectionState" + name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] ) """A collection of information about the state of the connection between service consumer and provider. Required.""" @@ -1030,16 +1138,16 @@ def __init__( *, private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState", private_endpoint: Optional["_models.PrivateEndpoint"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1050,7 +1158,7 @@ class PrivateEndpointConnectionResource(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1064,7 +1172,9 @@ class PrivateEndpointConnectionResource(ProxyResource): :vartype properties: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionProperties """ - properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field() + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1072,16 +1182,16 @@ def __init__( self, *, properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1092,7 +1202,7 @@ class PrivateLinkResource(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1106,7 +1216,9 @@ class PrivateLinkResource(ProxyResource): :vartype properties: ~azure.mgmt.mongocluster.models.PrivateLinkResourceProperties """ - properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field() + properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1114,16 +1226,16 @@ def __init__( self, *, properties: Optional["_models.PrivateLinkResourceProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1144,7 +1256,9 @@ class PrivateLinkResourceProperties(_model_base.Model): """The private link resource group id.""" required_members: Optional[List[str]] = rest_field(name="requiredMembers", visibility=["read"]) """The private link resource required member names.""" - required_zone_names: Optional[List[str]] = rest_field(name="requiredZoneNames") + required_zone_names: Optional[List[str]] = rest_field( + name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"] + ) """The private link resource private link DNS zone name.""" @overload @@ -1152,16 +1266,16 @@ def __init__( self, *, required_zone_names: Optional[List[str]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1179,12 +1293,16 @@ class PrivateLinkServiceConnectionState(_model_base.Model): :vartype actions_required: str """ - status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = rest_field() + status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" - description: Optional[str] = rest_field() + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The reason for approval/rejection of the connection.""" - actions_required: Optional[str] = rest_field(name="actionsRequired") + actions_required: Optional[str] = rest_field( + name="actionsRequired", visibility=["read", "create", "update", "delete", "query"] + ) """A message indicating if changes on the service provider require any updates on the consumer.""" @overload @@ -1194,16 +1312,16 @@ def __init__( status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, description: Optional[str] = None, actions_required: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1219,9 +1337,13 @@ class PromoteReplicaRequest(_model_base.Model): :vartype mode: str or ~azure.mgmt.mongocluster.models.PromoteMode """ - promote_option: Union[str, "_models.PromoteOption"] = rest_field(name="promoteOption") + promote_option: Union[str, "_models.PromoteOption"] = rest_field( + name="promoteOption", visibility=["read", "create", "update", "delete", "query"] + ) """The promote option to apply to the operation. Required. \"Forced\"""" - mode: Optional[Union[str, "_models.PromoteMode"]] = rest_field() + mode: Optional[Union[str, "_models.PromoteMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The mode to apply to the promote operation. Value is optional and default value is 'Switchover'. \"Switchover\"""" @@ -1231,16 +1353,16 @@ def __init__( *, promote_option: Union[str, "_models.PromoteOption"], mode: Optional[Union[str, "_models.PromoteMode"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1250,7 +1372,7 @@ class Replica(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1264,7 +1386,9 @@ class Replica(ProxyResource): :vartype properties: ~azure.mgmt.mongocluster.models.MongoClusterProperties """ - properties: Optional["_models.MongoClusterProperties"] = rest_field() + properties: Optional["_models.MongoClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1272,16 +1396,16 @@ def __init__( self, *, properties: Optional["_models.MongoClusterProperties"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1320,7 +1444,9 @@ class ShardingProperties(_model_base.Model): :vartype shard_count: int """ - shard_count: Optional[int] = rest_field(name="shardCount") + shard_count: Optional[int] = rest_field( + name="shardCount", visibility=["read", "create", "update", "delete", "query"] + ) """Number of shards to provision on the cluster.""" @overload @@ -1328,16 +1454,16 @@ def __init__( self, *, shard_count: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1349,7 +1475,7 @@ class StorageProperties(_model_base.Model): :vartype size_gb: int """ - size_gb: Optional[int] = rest_field(name="sizeGb") + size_gb: Optional[int] = rest_field(name="sizeGb", visibility=["read", "create", "update", "delete", "query"]) """The size of the data disk assigned to each server.""" @overload @@ -1357,16 +1483,16 @@ def __init__( self, *, size_gb: Optional[int] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1389,19 +1515,29 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_by: Optional[str] = rest_field(name="createdBy") + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that created the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that last modified the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource last modification (UTC).""" @overload @@ -1414,14 +1550,14 @@ 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, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/__init__.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/__init__.py index c2fa532ddd59..75f58de4243d 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/__init__.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import MongoClustersOperations -from ._operations import FirewallRulesOperations -from ._operations import PrivateEndpointConnectionsOperations -from ._operations import PrivateLinksOperations -from ._operations import ReplicasOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import MongoClustersOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinksOperations # type: ignore +from ._operations import ReplicasOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -25,5 +31,5 @@ "PrivateLinksOperations", "ReplicasOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/_operations.py b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/_operations.py index d5b197cabcde..58bdc3ccb78b 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/_operations.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,9 +9,10 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -32,14 +33,15 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer +from .._configuration import MongoClusterMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer from .._validation import api_version_validation if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,7 +54,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,11 +75,11 @@ def build_mongo_clusters_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -102,11 +104,11 @@ def build_mongo_clusters_create_or_update_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -133,11 +135,11 @@ def build_mongo_clusters_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -163,11 +165,11 @@ def build_mongo_clusters_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -191,7 +193,7 @@ def build_mongo_clusters_list_by_resource_group_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +218,7 @@ def build_mongo_clusters_list_request(subscription_id: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,11 +244,11 @@ def build_mongo_clusters_list_connection_strings_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -271,11 +273,11 @@ def build_mongo_clusters_check_name_availability_request( # pylint: disable=nam _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str"), @@ -301,11 +303,11 @@ def build_mongo_clusters_promote_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/promote" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/promote" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -331,11 +333,11 @@ def build_firewall_rules_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -361,11 +363,11 @@ def build_firewall_rules_create_or_update_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -392,11 +394,11 @@ def build_firewall_rules_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -421,11 +423,11 @@ def build_firewall_rules_list_by_mongo_cluster_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -449,11 +451,11 @@ def build_private_endpoint_connections_list_by_mongo_cluster_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -481,11 +483,11 @@ def build_private_endpoint_connections_get_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -517,11 +519,11 @@ def build_private_endpoint_connections_create_request( # pylint: disable=name-t _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -554,11 +556,11 @@ def build_private_endpoint_connections_delete_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -585,11 +587,11 @@ def build_private_links_list_by_mongo_cluster_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateLinkResources" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateLinkResources" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -613,11 +615,11 @@ def build_replicas_list_by_parent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/replicas" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/replicas" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -647,10 +649,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -668,7 +670,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -731,7 +733,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -751,10 +753,10 @@ class MongoClustersOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -772,7 +774,7 @@ def get(self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any) :rtype: ~azure.mgmt.mongocluster.models.MongoCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +814,7 @@ def get(self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -835,7 +837,7 @@ def _create_or_update_initial( resource: Union[_models.MongoCluster, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -884,7 +886,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1074,7 +1076,7 @@ def _update_initial( properties: Union[_models.MongoClusterUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1125,7 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1308,7 +1310,7 @@ def get_long_running_output(pipeline_response): params_added_on={"2024-06-01-preview": ["base_url"]}, ) def _delete_initial(self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1347,7 +1349,7 @@ def _delete_initial(self, resource_group_name: str, mongo_cluster_name: str, **k except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1441,7 +1443,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite cls: ClsType[List[_models.MongoCluster]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1506,7 +1508,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1529,7 +1531,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.MongoCluster"]: cls: ClsType[List[_models.MongoCluster]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1593,7 +1595,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1620,7 +1622,7 @@ def list_connection_strings( :rtype: ~azure.mgmt.mongocluster.models.ListConnectionStringsResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1660,7 +1662,7 @@ def list_connection_strings( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1754,7 +1756,7 @@ def check_name_availability( :rtype: ~azure.mgmt.mongocluster.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1803,7 +1805,7 @@ def check_name_availability( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1837,7 +1839,7 @@ def _promote_initial( body: Union[_models.PromoteReplicaRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1886,7 +1888,7 @@ def _promote_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2077,10 +2079,10 @@ class FirewallRulesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -2102,7 +2104,7 @@ def get( :rtype: ~azure.mgmt.mongocluster.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2143,7 +2145,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2167,7 +2169,7 @@ def _create_or_update_initial( resource: Union[_models.FirewallRule, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2217,7 +2219,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2413,7 +2415,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, mongo_cluster_name: str, firewall_rule_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2453,7 +2455,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2556,7 +2558,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2622,7 +2624,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2642,10 +2644,10 @@ class PrivateEndpointConnectionsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -2671,7 +2673,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2737,7 +2739,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2766,7 +2768,7 @@ def get( :rtype: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2807,7 +2809,7 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2831,7 +2833,7 @@ def _create_initial( resource: Union[_models.PrivateEndpointConnectionResource, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2881,7 +2883,7 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3090,7 +3092,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3130,7 +3132,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3224,10 +3226,10 @@ class PrivateLinksOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -3252,7 +3254,7 @@ def list_by_mongo_cluster( cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3318,7 +3320,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3338,10 +3340,10 @@ class ReplicasOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MongoClusterMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( @@ -3376,7 +3378,7 @@ def list_by_parent( cls: ClsType[List[_models.Replica]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3442,7 +3444,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create.py index 0c9ca9ac7a68..38957b9841d5 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_Create.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_Create.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_geo_replica.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_geo_replica.py index 478375d13e19..5697d4169e36 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_geo_replica.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_geo_replica.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_CreateGeoReplica.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_CreateGeoReplica.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_pitr.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_pitr.py index bbc19a418909..a7b5fb907e41 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_pitr.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_create_pitr.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_CreatePITR.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_CreatePITR.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_delete.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_delete.py index 8c9dedf1d90f..ce5e2764cdb8 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_delete.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2024-07-01/MongoClusters_Delete.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_create.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_create.py index 8c37ec59ae62..ebb5861a1798 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_create.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_create.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleCreate.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_delete.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_delete.py index 8a01ba9d6a91..877f0b114e0a 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_delete.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleDelete.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_get.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_get.py index e1fa3973c747..7c83b2ef8f9e 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_get.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleGet.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_list.py index 2f8d653da357..47c82daf4865 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_firewall_rule_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleList.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_force_promote_replica.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_force_promote_replica.py index 18d52b74fefa..67f024dd2914 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_force_promote_replica.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_force_promote_replica.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2024-07-01/MongoClusters_ForcePromoteReplica.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_ForcePromoteReplica.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_get.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_get.py index 0aadca7b500e..9acd2e55f72d 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_get.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_Get.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list.py index 7a526e9e56a1..d3822af7cc67 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_List.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_List.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_by_resource_group.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_by_resource_group.py index fd3668444f5a..9f800df9d252 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_by_resource_group.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_ListByResourceGroup.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_connection_strings.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_connection_strings.py index 7fcbf7399c6d..27be3973bc0a 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_connection_strings.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_list_connection_strings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_ListConnectionStrings.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_ListConnectionStrings.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability.py index b346f7ce5939..cd83f70c9b76 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_NameAvailability.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_NameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability_already_exists.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability_already_exists.py index d55107e72039..e5e921a61756 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability_already_exists.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_name_availability_already_exists.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_NameAvailability_AlreadyExists.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_data_api.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_data_api.py new file mode 100644 index 000000000000..a4fade33a774 --- /dev/null +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_data_api.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.mongocluster import MongoClusterMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-mongocluster +# USAGE + python mongo_clusters_patch_data_api.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 = MongoClusterMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.mongo_clusters.begin_update( + resource_group_name="TestResourceGroup", + mongo_cluster_name="myMongoCluster", + properties={"properties": {"dataApi": {"mode": "Enabled"}}}, + ).result() + print(response) + + +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchDataApi.json +if __name__ == "__main__": + main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_disk_size.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_disk_size.py index d5b050f071af..7bd14833512c 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_disk_size.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_disk_size.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_PatchDiskSize.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchDiskSize.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_private_network_access.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_private_network_access.py index 1a3e65678149..883838e1c90c 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_private_network_access.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_patch_private_network_access.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_PatchPrivateNetworkAccess.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchPrivateNetworkAccess.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_delete.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_delete.py index 088f48dc338a..75e5d9ff597d 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_delete.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_get.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_get.py index 4b25e0b76332..23de9199f17e 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_get.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_list.py index 875ed7c6d7f5..4585818804e2 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionList.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_put.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_put.py index 07f5a9a2bd78..142c315ae411 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_put.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_endpoint_connection_put.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionPut.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_link_resource_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_link_resource_list.py index 2026fb4bfffe..0a382068d883 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_link_resource_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_private_link_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_PrivateLinkResourceList.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateLinkResourceList.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_replica_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_replica_list.py index f22f11480bd7..c40fdf3e62fb 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_replica_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_replica_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/MongoClusters_ReplicaList.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_ReplicaList.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_reset_password.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_reset_password.py index d5eaa01866e2..ea461a41ffa3 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_reset_password.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_reset_password.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_ResetPassword.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_ResetPassword.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_update.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_update.py index 16bbc5422c0c..13a779509156 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_update.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/mongo_clusters_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2024-07-01/MongoClusters_Update.json +# x-ms-original-file: 2024-10-01-preview/MongoClusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/operations_list.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/operations_list.py index 062d83ab92c3..ca5f9b3e39ed 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/operations_list.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-07-01/Operations_List.json +# x-ms-original-file: 2024-10-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations.py index a70bf65845e6..22659847de05 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations.py @@ -46,6 +46,7 @@ def test_mongo_clusters_begin_create_or_update(self, resource_group): "compute": {"tier": "str"}, "connectionString": "str", "createMode": "str", + "dataApi": {"mode": "str"}, "highAvailability": {"targetMode": "str"}, "infrastructureVersion": "str", "previewFeatures": ["str"], @@ -110,6 +111,7 @@ def test_mongo_clusters_begin_update(self, resource_group): "administrator": {"password": "str", "userName": "str"}, "backup": {"earliestRestoreTime": "str"}, "compute": {"tier": "str"}, + "dataApi": {"mode": "str"}, "highAvailability": {"targetMode": "str"}, "previewFeatures": ["str"], "publicNetworkAccess": "str", diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations_async.py b/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations_async.py index 854e0d8a44d1..5bef7b74b28e 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations_async.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/generated_tests/test_mongo_cluster_mgmt_mongo_clusters_operations_async.py @@ -48,6 +48,7 @@ async def test_mongo_clusters_begin_create_or_update(self, resource_group): "compute": {"tier": "str"}, "connectionString": "str", "createMode": "str", + "dataApi": {"mode": "str"}, "highAvailability": {"targetMode": "str"}, "infrastructureVersion": "str", "previewFeatures": ["str"], @@ -114,6 +115,7 @@ async def test_mongo_clusters_begin_update(self, resource_group): "administrator": {"password": "str", "userName": "str"}, "backup": {"earliestRestoreTime": "str"}, "compute": {"tier": "str"}, + "dataApi": {"mode": "str"}, "highAvailability": {"targetMode": "str"}, "previewFeatures": ["str"], "publicNetworkAccess": "str", diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/tests/test_cli_mgmt_mongocluster_lro_test.py b/sdk/mongocluster/azure-mgmt-mongocluster/tests/test_cli_mgmt_mongocluster_lro_test.py index 24e1c5fa4afe..b16765ccc8de 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/tests/test_cli_mgmt_mongocluster_lro_test.py +++ b/sdk/mongocluster/azure-mgmt-mongocluster/tests/test_cli_mgmt_mongocluster_lro_test.py @@ -5,6 +5,7 @@ AZURE_LOCATION = "westus2" Mongo_Cluster_Name = "pythonmongoclustertest" + @pytest.mark.live_test_only class TestMgmtMongoCluster(AzureMgmtRecordedTestCase): @@ -63,4 +64,4 @@ def test_mongo_clusters_mgmt(self, resource_group): response = self.client.mongo_clusters.begin_delete( resource_group_name=resource_group.name, mongo_cluster_name=Mongo_Cluster_Name, - ).result() \ No newline at end of file + ).result() diff --git a/sdk/mongocluster/azure-mgmt-mongocluster/tsp-location.yaml b/sdk/mongocluster/azure-mgmt-mongocluster/tsp-location.yaml index 13cd4360ebd3..3733fcacd9de 100644 --- a/sdk/mongocluster/azure-mgmt-mongocluster/tsp-location.yaml +++ b/sdk/mongocluster/azure-mgmt-mongocluster/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/mongocluster/DocumentDB.MongoCluster.Management -commit: f93850874010501f216ceadf19459402efd16d9e +commit: fbb413f68a8ca8acf5f03ac50fbf54a63cf1d716 repo: Azure/azure-rest-api-specs additionalDirectories: