Module aws_lambda_powertools.utilities.data_classes.shared_functions
Functions
-
Decodes a Base64-encoded string and returns the decoded value.
Parameters
value
:str
- The Base64-encoded string to decode.
Returns
str
- The decoded string value.
-
Get the value of a header by its name.
Parameters
headers
:Dict[str, str]
- The dictionary of headers.
name
:str
- The name of the header to retrieve.
default_value
:str
, optional- The default value to return if the header is not found. Default is None.
case_sensitive
:bool
, optional- Indicates whether the header name should be case-sensitive. Default is False.
Returns
str
, optional- The value of the header if found, otherwise the default value or None.
-
Retrieves the values of a multi-value string parameters specified by the given name.
Parameters
name
:str
- The name of the query string parameter to retrieve.
default_value
:list[str]
, optional- The default value to return if the parameter is not found. Defaults to None.
Returns
List[str]. optional
- The values of the query string parameter if found, or the default values if not found.
-
Retrieves the value of a query string parameter specified by the given name.
Parameters
name
:str
- The name of the query string parameter to retrieve.
default_value
:str
, optional- The default value to return if the parameter is not found. Defaults to None.
Returns
str. optional
- The value of the query string parameter if found, or the default value if not found.