def METHOD_NAME(
    cls,
    state_schema_version: int,
    can_fetch_latest_specs: bool = False
) -> Dict[str, base.BaseInteractionDict]:
    """Returns a dict containing the full specs of each interaction for the
    given state schema version, if available else return all specs or an
    error depending on can_fetch_latest_specs.
    Args:
        state_schema_version: int. The state schema version to retrieve
            interaction specs for.
        can_fetch_latest_specs: boolean. Whether to fetch the latest specs
            if the legacy specs file is not found.
    Returns:
        dict. The interaction specs for the given state schema
        version, in the form of a mapping of interaction id to the
        interaction specs. See interaction_specs.json for an example.
    Raises:
        OSError. No interaction specs json file found for the given state
            schema version.
    """
    if (state_schema_version not in
            cls._state_schema_version_to_interaction_specs):
        spec_file_path = os.path.join(
            'interactions',
            'legacy_interaction_specs_by_state_version',
            'interaction_specs_state_v%i.json' % state_schema_version
        )
        spec_file_contents: Optional[str]
        try:
            spec_file_contents = constants.get_package_file_contents(
                'extensions', spec_file_path
            )
        except FileNotFoundError:
            spec_file_contents = None
        if spec_file_contents:
            specs_from_json: Dict[str, base.BaseInteractionDict] = (
                json.loads(spec_file_contents)
            )
            cls._state_schema_version_to_interaction_specs[
                state_schema_version] = specs_from_json
            return cls._state_schema_version_to_interaction_specs[
                state_schema_version]
        elif can_fetch_latest_specs:
            return cls.get_all_specs()
        else:
            raise IOError(
                'No specs JSON file found for state schema v%i' %
                state_schema_version)
    return cls._state_schema_version_to_interaction_specs[
        state_schema_version]