def METHOD_NAME(
    definition_type: str, api_client: airbyte_api_client.ApiClient, workspace_id: str, definition_id: str
) -> Union[SourceDefinition, DestinationDefinition]:
    if definition_type == "source":
        definition = SourceDefinition(api_client, definition_id)
        specification = SourceDefinitionSpecification(api_client, workspace_id, definition_id)
    elif definition_type == "destination":
        definition = DestinationDefinition(api_client, definition_id)
        specification = DestinationDefinitionSpecification(api_client, workspace_id, definition_id)
    else:
        raise ValueError(f"{definition_type} does not exist")
    definition.specification = specification
    return definition