private static void ValidateMarketplaceCompatibility(string reportType, IEnumerable <string> requestedMarketplacesIds = null) { if (requestedMarketplacesIds == null) { return; } var permittedMarketplacesIds = ReportsPermittedMarketplacesMapper.GetMarketplaces(reportType)?.Select(m => m.Id) ?? MwsMarketplaceGroup.AmazonGlobal().Select(m => m.Id); foreach (var requestedMarketplace in requestedMarketplacesIds) { if (!permittedMarketplacesIds.Contains(requestedMarketplace)) { throw new ArgumentException( $@"The report request for type:'{reportType}', is only available to the following marketplaces:'{ MwsMarketplace.GetMarketplaceCountryCodesAsCommaSeparatedString(permittedMarketplacesIds) }'. The requested marketplace:'{ MwsMarketplace.GetMarketplaceCountryCode(requestedMarketplace) }' is not supported by Amazon MWS for the specified report type" ); } } }