(domain, use_case_search=False)
return set(query.run().aggregations.case_types.keys)
Returns case types for which there is at least one existing case.

    get_case_types_for_domain is preferred for most uses
Returns case types for which there is at least one existing case.
Returns case types for which there is at least one existing case .
def get_case_types_for_domain_es(domain, use_case_search=False):
    """
    Returns case types for which there is at least one existing case.

    get_case_types_for_domain is preferred for most uses
    """
    index_class = CaseSearchES if use_case_search else CaseES
    query = (
        index_class().domain(domain).size(0)
        .terms_aggregation("type.exact", "case_types")
    )
    return set(query.run().aggregations.case_types.keys)
def get_case_types_for_domain_es ( domain , use_case_search = False ) : index_class = CaseSearchES if use_case_search else CaseES query = ( index_class ( ) . domain ( domain ) . size ( 0 ) . terms_aggregation ( "type.exact" , "case_types" ) ) return set ( query . run ( ) . aggregations . case_types . keys )