def METHOD_NAME(
    self,
    stack: Stack,
    layer_logical_id: str,
    codeuri: str,
    compatible_runtimes: Optional[List[str]],
    metadata: Optional[Dict],
    compatible_architectures: Optional[List[str]],
) -> LayerVersion:
    """
    Convert layer resource into {LayerVersion} object.
    Parameters
    ----------
    stack
    layer_logical_id
        LogicalID of resource.
    codeuri
        codeuri of the layer
    compatible_runtimes
        list of compatible runtimes
    metadata
        dictionary of layer metadata
    compatible_architectures
        list of compatible architecture
    Returns
    -------
    LayerVersion
        The layer object
    """
    if codeuri and not self._use_raw_codeuri:
        LOG.debug("--base-dir is not presented, adjusting uri %s relative to %s", codeuri, stack.location)
        codeuri = SamLocalStackProvider.normalize_resource_path(stack.location, codeuri)
    return LayerVersion(
        layer_logical_id,
        codeuri,
        compatible_runtimes,
        metadata,
        compatible_architectures=compatible_architectures,
        stack_path=stack.stack_path,
    )