Ë
    €Ïi	  ã                   óJ   — d Z ddlmZ ddlmZ ddlmZ ddlmZ dZd
d„Zd	„ Z	y)zParse workerpool config files.é    )Úabsolute_import)Údivision)Úunicode_literals)Úcloudbuild_utilzworkerpool configNc                 óT   — t        j                  | |j                  t        g |«      }|S )a  Load a workerpool config file into a WorkerPool message.

  Args:
    stream: file-like object containing the JSON or YAML data to be decoded.
    messages: module, The messages module that has a WorkerPool type.
    path: str or None. Optional path to be used in error messages.

  Raises:
    ParserError: If there was a problem parsing the stream as a dict.
    ParseProtoException: If there was a problem interpreting the stream as the
      given message type.

  Returns:
    WorkerPool message, The worker pool that got decoded.
  )r   ÚLoadMessageFromStreamÚ
WorkerPoolÚ _WORKERPOOL_CONFIG_FRIENDLY_NAME)ÚstreamÚmessagesÚpathÚwps       ú:lib/googlecloudsdk/api_lib/cloudbuild/workerpool_config.pyÚLoadWorkerpoolConfigFromStreamr      s,   € ô  ×,Ñ,Øˆh×!Ñ!Ô#CÀRÈóO€"à	€)ó    c                 ó<   — t        j                  | |t        «      }|S )aç  Load a workerpool config file into a WorkerPool message.

  Args:
    path: str. Path to the JSON or YAML data to be decoded.
    msg_type: The protobuf message type to create.

  Raises:
    files.MissingFileError: If the file does not exist.
    ParserError: If there was a problem parsing the file as a dict.
    ParseProtoException: If there was a problem interpreting the file as the
      given message type.

  Returns:
    WorkerPool message, The worker pool that got decoded.
  )r   ÚLoadMessageFromPathr
   )r   Úmsg_typer   s      r   ÚLoadWorkerpoolConfigFromPathr   0   s!   € ô  ×*Ñ*¨4°Ü+KóM€"à	€)r   )N)
Ú__doc__Ú
__future__r   r   r   Ú!googlecloudsdk.api_lib.cloudbuildr   r
   r   r   © r   r   Ú<module>r      s(   ðñ %å &Ý Ý 'å =ð $7Ð  óó*r   