private static Supplier<PrepareParams> createPrepareParams(
            Clock clock, Duration timeout, Session session, boolean isInternalRedeployment,
            boolean isBootstrap, boolean ignoreValidationErrors, boolean force, boolean waitForResourcesInPrepare) {

        // Use supplier because we shouldn't/can't create this before validateSessionStatus() for prepared deployments,
        // memoize because we want to create this once for unprepared deployments
        return new Memoized<>(() -> {
            TimeoutBudget timeoutBudget = new TimeoutBudget(clock, timeout);

            PrepareParams.Builder params = new PrepareParams.Builder()
                    .applicationId(session.getApplicationId())
                    .vespaVersion(session.getVespaVersion().toString())
                    .vespaVersionToBuildFirst(session.getVersionToBuildFirst())
                    .timeoutBudget(timeoutBudget)
                    .ignoreValidationErrors(ignoreValidationErrors)
                    .isBootstrap(isBootstrap)
                    .isInternalRedeployment(isInternalRedeployment)
                    .force(force)
                    .waitForResourcesInPrepare(waitForResourcesInPrepare)
                    .tenantVaults(session.getTenantVaults())
                    .tenantSecretStores(session.getTenantSecretStores())
                    .dataplaneTokens(session.getDataplaneTokens());
            session.getDockerImageRepository().ifPresent(params::dockerImageRepository);
            session.getAthenzDomain().ifPresent(params::athenzDomain);
            session.getCloudAccount().ifPresent(params::cloudAccount);

            return params.build();
        });
    }
@param clock system clock
@param timeout total timeout duration of prepare + activate
@param session the local session for this deployment
@param isBootstrap true if this deployment is done to bootstrap the config server
@param ignoreValidationErrors whether this model should be validated
@param force whether activation of this model should be forced
configserver/src/main/java/com/yahoo/vespa/config/server/deploy/Deployment.java