import { ogury } from "../protos/protos"; import { RequestInventorySource } from "../models"; import ConsentAds = ogury.ConsentAds; import InventorySource = ogury.InventorySource; export function consentAdsToEnum(ads?: string): ConsentAds { switch (ads) { case "TARGETED": return ConsentAds.CONSENT_ADS_TARGETED; case "ALLOWED": return ConsentAds.CONSENT_ADS_ALLOWED; case "DENIED": return ConsentAds.CONSENT_ADS_DENIED; default: return ConsentAds.CONSENT_ADS_UNKNOWN; } } export function inventorySourceToEnum(inventorySource: RequestInventorySource): InventorySource { switch (inventorySource) { case RequestInventorySource.INTERNAL: return InventorySource.INTERNAL; case RequestInventorySource.EXTERNAL: return InventorySource.EXTERNAL; case RequestInventorySource.HEADER_BIDDING: return InventorySource.HEADER_BIDDING; } }