def get_export_resource_by_id()

in dataplex-quickstart-labs/00-resources/scripts/python/business-glossary-import/bg_import/business_glossary_export_v2.py [0:0]


def get_export_resource_by_id(entry_id: str, entry_type: str) -> str:
    """
    Construct the export resource name based on the entry id and type.
    
    Args: 
        entry_id (str): The entry id.
        entry_type (str): The entry type.
        project (str): The project id.
        location (str): The location id.
        glossary (str): The glossary id.
    Returns: str: The export resource name.
    """
    glossary_child_resources = ""
    if entry_type == "glossary_term":
        glossary_child_resources = "terms"
    elif entry_type == "glossary_category":
        glossary_child_resources = "categories"
    
    if glossary_child_resources:
        return f"projects/{PROJECT}/locations/{LOCATION}/glossaries/{GLOSSARY}/{glossary_child_resources}/{entry_id}"
    else:
        return f"projects/{PROJECT}/locations/{LOCATION}/glossaries/{GLOSSARY}"