ó
    €Ïi	  ã                   óL   • S r SSKJr  SSKJr  SSKJr  SSKJr  SrS
S jrS	 r	g)zParse workerpool config files.é    )Úabsolute_import)Údivision)Úunicode_literals)Úcloudbuild_utilzworkerpool configNc                 óT   • [         R                  " XR                  [        / U5      nU$ )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*   € ô  ×,Ò,Ø×!Ñ!Ô#CÀRÈóO€"à	€)ó    c                 ó<   • [         R                  " X[        5      nU$ )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   