mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-24 09:48:39 +08:00
[hvac] Clarify and improve some annotations (#13886)
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import requests
|
||||
|
||||
class SigV4Auth:
|
||||
access_key: str
|
||||
secret_key: str
|
||||
session_token: str | None
|
||||
region: str
|
||||
def __init__(self, access_key: str, secret_key: str, session_token: str | None = None, region: str = "us-east-1") -> None: ...
|
||||
def add_auth(self, request) -> None: ...
|
||||
def add_auth(self, request: requests.PreparedRequest) -> None: ...
|
||||
|
||||
def generate_sigv4_auth_request(header_value: str | None = None): ...
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
from collections.abc import Iterable
|
||||
from typing import Any
|
||||
from typing_extensions import Self
|
||||
|
||||
class VaultError(Exception):
|
||||
errors: Iterable[Any] | str | None
|
||||
errors: Iterable[str] | str | None
|
||||
method: str | None
|
||||
url: str | None
|
||||
text: str | None
|
||||
@@ -11,7 +10,7 @@ class VaultError(Exception):
|
||||
def __init__(
|
||||
self,
|
||||
message: str | None = None,
|
||||
errors: Iterable[Any] | str | None = None,
|
||||
errors: Iterable[str] | str | None = None,
|
||||
method: str | None = None,
|
||||
url: str | None = None,
|
||||
text: str | None = None,
|
||||
@@ -22,7 +21,7 @@ class VaultError(Exception):
|
||||
cls,
|
||||
status_code: int,
|
||||
message: str | None = ...,
|
||||
errors: Iterable[Any] | str | None = ...,
|
||||
errors: Iterable[str] | str | None = ...,
|
||||
method: str | None = ...,
|
||||
url: str | None = ...,
|
||||
text: str | None = ...,
|
||||
|
||||
@@ -16,7 +16,7 @@ def raise_for_error(
|
||||
url: str,
|
||||
status_code: int,
|
||||
message: str | None = None,
|
||||
errors: Iterable[Any] | str | None = None,
|
||||
errors: Iterable[str] | str | None = None,
|
||||
text: str | None = None,
|
||||
json: object | None = None,
|
||||
) -> NoReturn: ...
|
||||
@@ -42,4 +42,6 @@ def comma_delimited_to_list(list_param: Iterable[_T]) -> Iterable[_T]: ...
|
||||
# the docstring states that this function returns a bool, but the code does not return anything
|
||||
def validate_pem_format(param_name: str, param_argument: str) -> None: ...
|
||||
def remove_nones(params: Mapping[_K, _V | None]) -> Mapping[_K, _V]: ...
|
||||
def format_url(format_str: str, *args: Any, **kwargs: Any) -> str: ...
|
||||
def format_url(
|
||||
format_str: str, *args: object, **kwargs: object
|
||||
) -> str: ... # values are passed to builtins.str, which takes an object type
|
||||
|
||||
Reference in New Issue
Block a user