Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Appconfig] Fix content validation issues for github.io #37281

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/appconfiguration/azure-appconfiguration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure

.. code-block:: python

from azure.appconfiguration import AzureAppConfigurationClient
from azure.appconfiguration import
YalinLi0312 marked this conversation as resolved.
Show resolved Hide resolved

connection_str = "<my connection string>"
client = AzureAppConfigurationClient.from_connection_string(connection_str)
"""
Expand All @@ -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
Expand Down Expand Up @@ -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]:
YalinLi0312 marked this conversation as resolved.
Show resolved Hide resolved
accept_datetime = kwargs.pop("accept_datetime", None)
if isinstance(accept_datetime, datetime):
accept_datetime = str(accept_datetime)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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".

Expand Down Expand Up @@ -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.

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<my connection string>"
async_client = AzureAppConfigurationClient.from_connection_string(connection_str)
"""
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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".

Expand Down Expand Up @@ -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.

Expand All @@ -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.
Expand Down