def METHOD_NAME(
    session: Session,
    name: str,
    management_ip: ipaddr.IPv4Address,
    room: Room,
    processor: User,
) -> Switch:
    switch = Switch(
        management_ip=management_ip, host=Host(room=room, owner=session.get(User, 0), name=name)
    )
    session.add(switch)
    message = deferred_gettext("Created switch '{}' with management IP {}.")\
        .format(switch.host.name, str(switch.management_ip))
    log_room_event(message.to_json(),
                   processor, switch.host.room)
    return switch