Helper for ``construct_settings()``.

    Args:
      method_config (dict): A dictionary representing a single ``methods``
        entry of the standard API client config file. (See
        ``construct_settings()`` for information on this yaml.)
      retry_codes (dict): A dictionary parsed from the ``retry_codes`` entry
        of the standard API client config file. (See ``construct_settings()``
        for information on this yaml.)
      retry_params (dict): A dictionary parsed from the ``retry_params`` entry
        of the standard API client config file. (See ``construct_settings()``
        for information on this yaml.)
      retry_names (dict): A dictionary mapping the string names used in the
        standard API client config file to API response status codes.

    Returns:
      Optional[RetryOptions]: The retry options, if applicable.

def _construct_retry(method_config, retry_codes, retry_params, retry_names):
    """Helper for ``construct_settings()``.

    Args:
      method_config (dict): A dictionary representing a single ``methods``
        entry of the standard API client config file. (See
        ``construct_settings()`` for information on this yaml.)
      retry_codes (dict): A dictionary parsed from the ``retry_codes`` entry
        of the standard API client config file. (See ``construct_settings()``
        for information on this yaml.)
      retry_params (dict): A dictionary parsed from the ``retry_params`` entry
        of the standard API client config file. (See ``construct_settings()``
        for information on this yaml.)
      retry_names (dict): A dictionary mapping the string names used in the
        standard API client config file to API response status codes.

    Returns:
      Optional[RetryOptions]: The retry options, if applicable.
    """
    if method_config is None:
        return None

    codes = None
    if retry_codes and 'retry_codes_name' in method_config:
        codes_name = method_config['retry_codes_name']
        if codes_name in retry_codes and retry_codes[codes_name]:
            codes = [retry_names[name] for name in retry_codes[codes_name]]
        else:
            codes = []

    backoff_settings = None
    if retry_params and 'retry_params_name' in method_config:
        params_name = method_config['retry_params_name']
        if params_name and params_name in retry_params:
            backoff_settings = gax.BackoffSettings(**retry_params[params_name])

    return gax.RetryOptions(
        backoff_settings=backoff_settings,
        retry_codes=codes,
    )