def METHOD_NAME(lease):
    # type: (ShareLeaseClient or str) -> DestinationLeaseAccessConditions or None
    try:
        lease_id = lease.id # type: ignore
    except AttributeError:
        lease_id = lease # type: ignore
    return DestinationLeaseAccessConditions(destination_lease_id=lease_id) if lease_id else None