def METHOD_NAME(
    self,
    ib_contract_pattern: ibContract,
    allow_expired: bool = False,
    allow_multiple_contracts: bool = False,
) -> Union[ibContractDetails, List[ibContractDetails]]:
    contract_details = self._get_contract_details(
        ib_contract_pattern, allow_expired=allow_expired
    )
    if len(contract_details) == 0:
        raise missingContract
    if allow_multiple_contracts:
        return contract_details
    elif len(contract_details) > 1:
        self.log.critical(
            "Multiple contracts and only expected one - returning the first"
        )
    return contract_details[0]