class_docstr: AWS Connection Wrapper class helper.
  
  Use for validate and resolve AWS Connection parameters.
  
  ``conn`` references an Airflow Connection object or AwsConnectionWrapper
      if it set to ``None`` than default values would use.
  
  The precedence rules for ``region_name``
      1. Explicit set (in Hook) ``region_name``.
      2. Airflow Connection Extra 'region_name'.
  
  The precedence rules for ``botocore_config``
      1. Explicit set (in Hook) ``botocore_config``.
      2. Construct from Airflow Connection Extra 'botocore_kwargs'.
      3. The wrapper's default value
code: def __post_init__(self, conn: Connection):
      if isinstance(conn, type(self)):
          # For every field with init=False we copy reference value from original wrapper
          # For every field with init=True we use init values if it not equal default
          # We can't use ``dataclasses.replace`` in classmethod because
          # we limited by InitVar arguments since it not stored in object,
          # and also we do not want to run __post_init__ method again which print all logs/warnings again.
          for fl in fields(conn):
              value = getattr(conn, fl.name)
              if not fl.init:
                  setattr(self, fl.name, value)
              else:
                  if fl.default is not MISSING:
                      default = fl.default
                  elif fl.default_factory is not MISSING:
                      default = (
                          fl.default_factory()
                      )  # zero-argument callable
                  else:
                      continue  # Value mandatory, skip
  
                  orig_value = getattr(self, fl.name)
                  if orig_value == default:
                      # Only replace value if it not equal default value
                      setattr(self, fl.name, value)
          return
      elif not conn:
          return
  
      # Assign attributes from AWS Connection
      self.conn_id = conn.conn_id
      self.conn_type = conn.conn_type or "aws"
      self.login = conn.login
      self.password = conn.password
      self.schema = conn.schema or None
      self.extra_config = deepcopy(conn.extra_dejson)
  
      if self.conn_type.lower() == "s3":
          warnings.warn(
              f"{self.conn_repr} has connection type 's3', "
              "which has been replaced by connection type 'aws'. "
              "Please update your connection to have `conn_type='aws'`.",
              AirflowProviderDeprecationWarning,
              stacklevel=2,
          )
      elif self.conn_type != "aws":
          warnings.warn(
              f"{self.conn_repr} expected connection type 'aws', got {self.conn_type!r}. "
              "This connection might not work correctly. "
              "Please use Amazon Web Services Connection type.",
              UserWarning,
              stacklevel=2,
          )
  
      extra = deepcopy(conn.extra_dejson)
      self.service_config = extra.get("service_config", {})
  
      session_kwargs = extra.get("session_kwargs", {})
      if session_kwargs:
          warnings.warn(
              "'session_kwargs' in extra config is deprecated and will be removed in a future releases. "
              f"Please specify arguments passed to boto3 Session directly in {self.conn_repr} extra.",
              AirflowProviderDeprecationWarning,
              stacklevel=2,
          )
  
      # Retrieve initial connection credentials
      init_credentials = self._get_credentials(**extra)
      (
          self.aws_access_key_id,
          self.aws_secret_access_key,
          self.aws_session_token,
      ) = init_credentials
  
      if not self.region_name:
          if "region_name" in extra:
              self.region_name = extra["region_name"]
              self.log.debug(
                  "Retrieving region_name=%s from %s extra.",
                  self.region_name,
                  self.conn_repr,
              )
          elif "region_name" in session_kwargs:
              self.region_name = session_kwargs["region_name"]
              self.log.debug(
                  "Retrieving region_name=%s from %s extra['session_kwargs'].",
                  self.region_name,
                  self.conn_repr,
              )
  
      if self.verify is None and "verify" in extra:
          self.verify = extra["verify"]
          self.log.debug(
              "Retrieving verify=%s from %s extra.",
              self.verify,
              self.conn_repr,
          )
  
      if "profile_name" in extra:
          self.profile_name = extra["profile_name"]
          self.log.debug(
              "Retrieving profile_name=%s from %s extra.",
              self.profile_name,
              self.conn_repr,
          )
      elif "profile_name" in session_kwargs:
          self.profile_name = session_kwargs["profile_name"]
          self.log.debug(
              "Retrieving profile_name=%s from %s extra['session_kwargs'].",
              self.profile_name,
              self.conn_repr,
          )
  
      # Warn the user that an invalid parameter is being used which actually not related to 'profile_name'.
      # ToDo: Remove this check entirely as soon as drop support credentials from s3_config_file
      if (
          "profile" in extra
          and "s3_config_file" not in extra
          and not self.profile_name
      ):
          warnings.warn(
              f"Found 'profile' without specifying 's3_config_file' in {self.conn_repr} extra. "
              "If required profile from AWS Shared Credentials please "
              f"set 'profile_name' in {self.conn_repr} extra.",
              UserWarning,
              stacklevel=2,
          )
  
      config_kwargs = extra.get("config_kwargs")
      if not self.botocore_config and config_kwargs:
          # https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
          self.log.debug(
              "Retrieving botocore config=%s from %s extra.",
              config_kwargs,
              self.conn_repr,
          )
          if config_kwargs.get("signature_version") == "unsigned":
              config_kwargs["signature_version"] = UNSIGNED
          self.botocore_config = Config(**config_kwargs)
  
      if conn.host:
          warnings.warn(
              f"Host {conn.host} specified in the connection is not used."
              " Please, set it on extra['endpoint_url'] instead",
              AirflowProviderDeprecationWarning,
              stacklevel=2,
          )
  
      self.endpoint_url = extra.get("host")
      if self.endpoint_url:
          warnings.warn(
              "extra['host'] is deprecated and will be removed in a future release."
              " Please set extra['endpoint_url'] instead",
              AirflowProviderDeprecationWarning,
              stacklevel=2,
          )
      else:
          self.endpoint_url = extra.get("endpoint_url")
  
      # Retrieve Assume Role Configuration
      assume_role_configs = self._get_assume_role_configs(**extra)
      (
          self.role_arn,
          self.assume_role_method,
          self.assume_role_kwargs,
      ) = assume_role_configs
  
imports: from __future__ import annotations
  import json
  import warnings
  from copy import deepcopy
  from dataclasses import MISSING, InitVar, dataclass, field, fields
  from functools import cached_property
  from typing import TYPE_CHECKING, Any
  from botocore import UNSIGNED
  from botocore.config import Config
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.utils import trim_none_values
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.log.secrets_masker import mask_secret
  from airflow.utils.types import NOTSET, ArgNotSet
label_desc: Use image node_id 4 for calling the AwsConnectionWrapper obj's underlying member method code with example usage: obj.__post_init__(conn) without return types