class BBInputSetup implements JavaDelegate {

    protected CloudRegion getCloudRegionFromMacroRequest(CloudConfiguration cloudConfiguration, Resources resources) {
        if (cloudConfiguration == null) {
            for (Vnfs vnfs : resources.getVnfs()) {
                if (cloudConfiguration == null) {
                    cloudConfiguration = vnfs.getCloudConfiguration();
                } else {
                    break;
                }
                for (VfModules vfModules : vnfs.getVfModules()) {
                    if (cloudConfiguration == null) {
                        cloudConfiguration = vfModules.getCloudConfiguration();
                    } else {
                        break;
                    }
                }
            }
            for (Networks networks : resources.getNetworks()) {
                if (cloudConfiguration == null) {
                    cloudConfiguration = networks.getCloudConfiguration();
                } else {
                    break;
                }
            }
        }
        if (cloudConfiguration != null) {
            org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration);
            return mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion);
        } else {
            logger.debug("Could not find any cloud configuration for this request.");
            return null;
        }
    }

}