class_docstr: Interact with Amazon Elastic Container Registry (ECR).
  
  Provide thin wrapper around :external+boto3:py:class:`boto3.client("ecr") <ECR.Client>`.
  
  Additional arguments (such as ``aws_conn_id``) may be specified and
  are passed down to the underlying AwsBaseHook.
  
  .. seealso::
      - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
docstr: Get temporary credentials for Amazon ECR.
  
  .. seealso::
      - :external+boto3:py:meth:`ECR.Client.get_authorization_token`
  
  :param registry_ids: Either AWS Account ID or list of AWS Account IDs that are associated
      with the registries from which credentials are obtained. If you do not specify a registry,
      the default registry is assumed.
  :return: list of :class:`airflow.providers.amazon.aws.hooks.ecr.EcrCredentials`,
      obtained credentials valid for 12 hours.
docstr_tok: ["Get","temporary","credentials","for","Amazon","ECR",".","..","seealso",":",":","-",":","external+boto3",":","py",":","meth",":","`","ECR.Client.get_authorization_token","`",":","param","registry_ids",":","Either","AWS","Account","ID","or","list","of","AWS","Account","IDs","that","are","associated","with","the","registries","from","which","credentials","are","obtained",".","If","you","do","not","specify","a","registry",",","the","default","registry","is","assumed",".",":","return",":","list","of",":","class",":","`","airflow.providers.amazon.aws.hooks.ecr.EcrCredentials","`",",","obtained","credentials","valid","for","12","hours","."]
code: def get_temporary_credentials(
      self, registry_ids: list[str] | str | None = None
  ) -> list[EcrCredentials]:
      """Get temporary credentials for Amazon ECR.
  
      .. seealso::
          - :external+boto3:py:meth:`ECR.Client.get_authorization_token`
  
      :param registry_ids: Either AWS Account ID or list of AWS Account IDs that are associated
          with the registries from which credentials are obtained. If you do not specify a registry,
          the default registry is assumed.
      :return: list of :class:`airflow.providers.amazon.aws.hooks.ecr.EcrCredentials`,
          obtained credentials valid for 12 hours.
      """
      registry_ids = registry_ids or None
      if isinstance(registry_ids, str):
          registry_ids = [registry_ids]
  
      if registry_ids:
          response = self.conn.get_authorization_token(
              registryIds=registry_ids
          )
      else:
          response = self.conn.get_authorization_token()
  
      creds = []
      for auth_data in response["authorizationData"]:
          username, password = (
              base64.b64decode(auth_data["authorizationToken"])
              .decode("utf-8")
              .split(":")
          )
          creds.append(
              EcrCredentials(
                  username=username,
                  password=password,
                  proxy_endpoint=auth_data["proxyEndpoint"],
                  expires_at=auth_data["expiresAt"],
              )
          )
  
      return creds
  
file_path: airflow/airflow/providers/amazon/aws/hooks/ecr.py
imports: from __future__ import annotations
  import base64
  import logging
  from dataclasses import dataclass
  from typing import TYPE_CHECKING
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.utils.log.secrets_masker import mask_secret
label_desc: Use image node_id 2 for calling the EcrHook obj's underlying member method code with example usage: obj.get_temporary_credentials(registry_ids) and returns: creds