diff --git a/sdk/appconfiguration/azure-appconfiguration/README.md b/sdk/appconfiguration/azure-appconfiguration/README.md index be7e16a6e5dc..39787faedbeb 100644 --- a/sdk/appconfiguration/azure-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-appconfiguration/README.md @@ -420,7 +420,7 @@ See the [troubleshooting guide][troubleshooting_guide] for details on how to dia Several App Configuration client library samples are available to you in this GitHub repository. These include: - [Hello world](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py) - [List configuration settings](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample_async.py) -- [Make a configuration setting readonly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py) +- [Make a configuration setting readonly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample_async.py) - [Read revision history](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample_async.py) - [Get a setting if changed](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample_async.py) - [Create, retrieve and update status of a configuration settings snapshot](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample_async.py) diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py index b029eeb7d1a6..57c60a9230cf 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py @@ -110,6 +110,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure .. code-block:: python from azure.appconfiguration import AzureAppConfigurationClient + connection_str = "" client = AzureAppConfigurationClient.from_connection_string(connection_str) """ @@ -123,7 +124,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure ) @distributed_trace - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs a network request using the client's existing pipeline. The request URL can be relative to the vault URL. The service API version used for the request is the same as @@ -212,7 +213,7 @@ def list_configuration_settings( """ @distributed_trace - def list_configuration_settings(self, *args, **kwargs) -> ItemPaged[ConfigurationSetting]: + def list_configuration_settings(self, *args: Optional[str], **kwargs: Any) -> ItemPaged[ConfigurationSetting]: accept_datetime = kwargs.pop("accept_datetime", None) if isinstance(accept_datetime, datetime): accept_datetime = str(accept_datetime) @@ -252,7 +253,7 @@ def get_configuration_setting( match_condition: MatchConditions = MatchConditions.Unconditionally, *, accept_datetime: Optional[Union[datetime, str]] = None, - **kwargs, + **kwargs: Any, ) -> Union[None, ConfigurationSetting]: """Get the matched ConfigurationSetting from Azure App Configuration service @@ -308,7 +309,9 @@ def get_configuration_setting( return None @distributed_trace - def add_configuration_setting(self, configuration_setting: ConfigurationSetting, **kwargs) -> ConfigurationSetting: + def add_configuration_setting( + self, configuration_setting: ConfigurationSetting, **kwargs: Any + ) -> ConfigurationSetting: """Add a ConfigurationSetting instance into the Azure App Configuration service. :param configuration_setting: The ConfigurationSetting object to be added @@ -351,7 +354,7 @@ def set_configuration_setting( match_condition: MatchConditions = MatchConditions.Unconditionally, *, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSetting: """Add or update a ConfigurationSetting. If the configuration setting identified by key and label does not exist, this is a create. @@ -418,7 +421,7 @@ def delete_configuration_setting( # pylint:disable=delete-operation-wrong-retur *, etag: Optional[str] = None, match_condition: MatchConditions = MatchConditions.Unconditionally, - **kwargs, + **kwargs: Any, ) -> Union[None, ConfigurationSetting]: """Delete a ConfigurationSetting if it exists @@ -478,7 +481,7 @@ def list_revisions( tags_filter: Optional[List[str]] = None, accept_datetime: Optional[Union[datetime, str]] = None, fields: Optional[List[Union[str, ConfigurationSettingFields]]] = None, - **kwargs, + **kwargs: Any, ) -> ItemPaged[ConfigurationSetting]: """ Find the ConfigurationSetting revision history, optionally filtered by key, label, tags and accept_datetime. @@ -543,7 +546,7 @@ def set_read_only( read_only: bool = True, *, match_condition: MatchConditions = MatchConditions.Unconditionally, - **kwargs, + **kwargs: Any, ) -> ConfigurationSetting: """Set a configuration setting read only @@ -608,7 +611,7 @@ def list_labels( after: Optional[str] = None, accept_datetime: Optional[Union[datetime, str]] = None, fields: Optional[List[Union[str, LabelFields]]] = None, - **kwargs, + **kwargs: Any, ) -> ItemPaged[ConfigurationSettingLabel]: """Gets a list of labels. @@ -649,7 +652,7 @@ def begin_create_snapshot( composition_type: Optional[Union[str, SnapshotComposition]] = None, retention_period: Optional[int] = None, tags: Optional[Dict[str, str]] = None, - **kwargs, + **kwargs: Any, ) -> LROPoller[ConfigurationSnapshot]: """Create a snapshot of the configuration settings. @@ -692,7 +695,7 @@ def archive_snapshot( *, match_condition: MatchConditions = MatchConditions.Unconditionally, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSnapshot: """Archive a configuration setting snapshot. It will update the status of a snapshot from "ready" to "archived". The retention period will start to count, the snapshot will expire when the entire retention period elapses. @@ -733,7 +736,7 @@ def recover_snapshot( *, match_condition: MatchConditions = MatchConditions.Unconditionally, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSnapshot: """Recover a configuration setting snapshot. It will update the status of a snapshot from "archived" to "ready". @@ -768,7 +771,7 @@ def recover_snapshot( @distributed_trace def get_snapshot( - self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs + self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs: Any ) -> ConfigurationSnapshot: """Get a configuration setting snapshot. @@ -793,7 +796,7 @@ def list_snapshots( name: Optional[str] = None, fields: Optional[List[Union[str, SnapshotFields]]] = None, status: Optional[List[Union[str, SnapshotStatus]]] = None, - **kwargs, + **kwargs: Any, ) -> ItemPaged[ConfigurationSnapshot]: """List the configuration setting snapshots stored in the configuration service, optionally filtered by snapshot name, snapshot status and fields to present in return. diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py index 6f636556094c..a0df4eeaec18 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py @@ -581,7 +581,7 @@ class ConfigurationSettingPropertiesPaged(PageIterator): etag: str """The etag of current page.""" - def __init__(self, command: Callable, **kwargs): + def __init__(self, command: Callable, **kwargs: Any): super(ConfigurationSettingPropertiesPaged, self).__init__( self._get_next_cb, self._extract_data_cb, @@ -620,7 +620,7 @@ class ConfigurationSettingPropertiesPagedAsync(AsyncPageIterator): etag: str """The etag of current page.""" - def __init__(self, command: Callable, **kwargs): + def __init__(self, command: Callable, **kwargs: Any): super(ConfigurationSettingPropertiesPagedAsync, self).__init__( self._get_next_cb, self._extract_data_cb, diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_utils.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_utils.py index b99694ffe7c6..8a27e219faf9 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_utils.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_utils.py @@ -67,7 +67,7 @@ def get_current_utc_time() -> str: return str(datetime.utcnow().strftime("%b, %d %Y %H:%M:%S.%f ")) + "GMT" -def get_key_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]: +def get_key_filter(*args: Optional[str], **kwargs: Any) -> Tuple[Optional[str], Dict[str, Any]]: key_filter = None if len(args) > 0: key_filter = args[0] @@ -79,7 +79,7 @@ def get_key_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]: return key_filter or kwargs.pop("key_filter", None), kwargs -def get_label_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]: +def get_label_filter(*args: Optional[str], **kwargs: Any) -> Tuple[Optional[str], Dict[str, Any]]: label_filter = None if len(args) > 1: label_filter = args[1] diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py index 0763070fc246..41ede3a58535 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py @@ -116,6 +116,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure .. code-block:: python from azure.appconfiguration.aio import AzureAppConfigurationClient + connection_str = "" async_client = AzureAppConfigurationClient.from_connection_string(connection_str) """ @@ -129,7 +130,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure ) @distributed_trace_async - async def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs) -> AsyncHttpResponse: + async def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> AsyncHttpResponse: """Runs a network request using the client's existing pipeline. The request URL can be relative to the vault URL. The service API version used for the request is the same as @@ -218,7 +219,7 @@ def list_configuration_settings( """ @distributed_trace - def list_configuration_settings(self, *args, **kwargs) -> AsyncItemPaged[ConfigurationSetting]: + def list_configuration_settings(self, *args: Optional[str], **kwargs: Any) -> AsyncItemPaged[ConfigurationSetting]: accept_datetime = kwargs.pop("accept_datetime", None) if isinstance(accept_datetime, datetime): accept_datetime = str(accept_datetime) @@ -259,7 +260,7 @@ async def get_configuration_setting( match_condition: MatchConditions = MatchConditions.Unconditionally, *, accept_datetime: Optional[Union[datetime, str]] = None, - **kwargs, + **kwargs: Any, ) -> Union[None, ConfigurationSetting]: """Get the matched ConfigurationSetting from Azure App Configuration service @@ -317,7 +318,7 @@ async def get_configuration_setting( @distributed_trace_async async def add_configuration_setting( - self, configuration_setting: ConfigurationSetting, **kwargs + self, configuration_setting: ConfigurationSetting, **kwargs: Any ) -> ConfigurationSetting: """Add a ConfigurationSetting instance into the Azure App Configuration service. @@ -363,7 +364,7 @@ async def set_configuration_setting( match_condition: MatchConditions = MatchConditions.Unconditionally, *, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSetting: """Add or update a ConfigurationSetting. If the configuration setting identified by key and label does not exist, this is a create. @@ -431,7 +432,7 @@ async def delete_configuration_setting( *, etag: Optional[str] = None, match_condition: MatchConditions = MatchConditions.Unconditionally, - **kwargs, + **kwargs: Any, ) -> Union[None, ConfigurationSetting]: """Delete a ConfigurationSetting if it exists @@ -492,7 +493,7 @@ def list_revisions( tags_filter: Optional[List[str]] = None, accept_datetime: Optional[Union[datetime, str]] = None, fields: Optional[List[Union[str, ConfigurationSettingFields]]] = None, - **kwargs, + **kwargs: Any, ) -> AsyncItemPaged[ConfigurationSetting]: """ Find the ConfigurationSetting revision history, optionally filtered by key, label, tags and accept_datetime. @@ -558,7 +559,7 @@ async def set_read_only( read_only: bool = True, *, match_condition: MatchConditions = MatchConditions.Unconditionally, - **kwargs, + **kwargs: Any, ) -> ConfigurationSetting: """Set a configuration setting read only @@ -623,7 +624,7 @@ def list_labels( after: Optional[str] = None, accept_datetime: Optional[Union[datetime, str]] = None, fields: Optional[List[Union[str, LabelFields]]] = None, - **kwargs, + **kwargs: Any, ) -> AsyncItemPaged[ConfigurationSettingLabel]: """Gets a list of labels. @@ -664,7 +665,7 @@ async def begin_create_snapshot( composition_type: Optional[Union[str, SnapshotComposition]] = None, retention_period: Optional[int] = None, tags: Optional[Dict[str, str]] = None, - **kwargs, + **kwargs: Any, ) -> AsyncLROPoller[ConfigurationSnapshot]: """Create a snapshot of the configuration settings. @@ -707,7 +708,7 @@ async def archive_snapshot( *, match_condition: MatchConditions = MatchConditions.Unconditionally, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSnapshot: """Archive a configuration setting snapshot. It will update the status of a snapshot from "ready" to "archived". The retention period will start to count, the snapshot will expire when the entire retention period elapses. @@ -748,7 +749,7 @@ async def recover_snapshot( *, match_condition: MatchConditions = MatchConditions.Unconditionally, etag: Optional[str] = None, - **kwargs, + **kwargs: Any, ) -> ConfigurationSnapshot: """Recover a configuration setting snapshot. It will update the status of a snapshot from "archived" to "ready". @@ -783,7 +784,7 @@ async def recover_snapshot( @distributed_trace_async async def get_snapshot( - self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs + self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs: Any ) -> ConfigurationSnapshot: """Get a configuration setting snapshot. @@ -808,7 +809,7 @@ def list_snapshots( name: Optional[str] = None, fields: Optional[List[Union[str, SnapshotFields]]] = None, status: Optional[List[Union[str, SnapshotStatus]]] = None, - **kwargs, + **kwargs: Any, ) -> AsyncItemPaged[ConfigurationSnapshot]: """List the configuration setting snapshots stored in the configuration service, optionally filtered by snapshot name, snapshot status and fields to present in return.