@Test public void headerBiddingBuilder() { TestAdRequestBuilder builder = new TestAdRequestBuilder(); assertTrue(builder.build().headerBiddingEnabled); builder.disableHeaderBidding(); assertFalse(builder.build().headerBiddingEnabled); builder.enableHeaderBidding(); assertTrue(builder.build().headerBiddingEnabled); }
@VisibleForTesting Object build(final android.content.Context context, AdsType adsType) { final String sellerId = BidMachineImpl.get().getSellerId(); if (TextUtils.isEmpty(sellerId)) { return BMError.paramError("Seller Id not provided"); } assert sellerId != null; BMError implVerifyError = verifyRequest(); if (implVerifyError != null) { return implVerifyError; } final BidMachineImpl bidMachine = BidMachineImpl.get(); AdvertisingPersonalData.syncUpdateInfo(context); final Request.Builder requestBuilder = Request.newBuilder(); final TargetingParams targetingParams = RequestParams.resolveParams(this.targetingParams, bidMachine.getTargetingParams()); final BlockedParams blockedParams = targetingParams.getBlockedParams(); final UserRestrictionParams userRestrictionParams = RequestParams.resolveParams(this.userRestrictionParams, bidMachine.getUserRestrictionParams()); unifiedAdRequestParams = createUnifiedAdRequestParams(targetingParams, userRestrictionParams); final PriceFloorParams priceFloorParams = oneOf(this.priceFloorParams, bidMachine.getPriceFloorParams()); final Map<String, Double> priceFloorsMap = priceFloorParams.getPriceFloors() == null || priceFloorParams.getPriceFloors().size() == 0 ? bidMachine.getPriceFloorParams().getPriceFloors() : priceFloorParams.getPriceFloors(); if (priceFloorsMap == null) { return BMError.paramError("PriceFloors not provided"); } final ArrayList<Message.Builder> placements = new ArrayList<>(); adsType.collectDisplayPlacements( new SimpleContextProvider(context), this, unifiedAdRequestParams, placements); final Request.Item.Builder itemBuilder = Request.Item.newBuilder(); itemBuilder.setId(UUID.randomUUID().toString()); itemBuilder.setQty(1); for (Map.Entry<String, Double> bid : priceFloorsMap.entrySet()) { final Request.Item.Deal.Builder dealBuilder = Request.Item.Deal.newBuilder(); dealBuilder.setId(bid.getKey()); dealBuilder.setFlr(bid.getValue()); dealBuilder.setFlrcur("USD"); itemBuilder.addDeal(dealBuilder); } final Placement.Builder placementBuilder = Placement.newBuilder(); placementBuilder.setSsai(0); placementBuilder.setSdk(BidMachine.NAME); placementBuilder.setSdkver(BidMachine.VERSION); placementBuilder.setSecure(!io.bidmachine.core.Utils.canUseCleartextTraffic()); for (Message.Builder displayBuilder : placements) { if (displayBuilder instanceof Placement.DisplayPlacement.Builder) { placementBuilder.setDisplay((Placement.DisplayPlacement.Builder) displayBuilder); } else if (displayBuilder instanceof Placement.VideoPlacement.Builder) { placementBuilder.setVideo((Placement.VideoPlacement.Builder) displayBuilder); } else { throw new IllegalArgumentException("Unsupported display type: " + displayBuilder); } } onBuildPlacement(placementBuilder); itemBuilder.setSpec(Any.pack(placementBuilder.build())); requestBuilder.addItem(itemBuilder.build()); final Context.Builder contextBuilder = Context.newBuilder(); final Context.App.Builder appBuilder = Context.App.newBuilder(); Publisher publisher = bidMachine.getPublisher(); if (publisher != null) { publisher.build(appBuilder); } targetingParams.build(context, appBuilder); contextBuilder.setApp(appBuilder); if (blockedParams != null) { final Context.Restrictions.Builder restrictionsBuilder = Context.Restrictions.newBuilder(); blockedParams.build(restrictionsBuilder); contextBuilder.setRestrictions(restrictionsBuilder); } final Context.User.Builder userBuilder = Context.User.newBuilder(); userRestrictionParams.build(userBuilder); if (userRestrictionParams.canSendUserInfo()) { targetingParams.build(userBuilder); } contextBuilder.setUser(userBuilder); final Context.Regs.Builder regsBuilder = Context.Regs.newBuilder(); userRestrictionParams.build(regsBuilder); contextBuilder.setRegs(regsBuilder); final Context.Device.Builder deviceBuilder = Context.Device.newBuilder(); bidMachine.getDeviceParams().build(context, deviceBuilder, targetingParams, bidMachine.getTargetingParams(), userRestrictionParams); contextBuilder.setDevice(deviceBuilder); requestBuilder.setContext(Any.pack(contextBuilder.build())); requestBuilder.setTest(bidMachine.isTestMode()); requestBuilder.addCur("USD"); requestBuilder.setAt(2); requestBuilder.setTmax(10000); final RequestExtension.Builder requestExtensionBuilder = RequestExtension.newBuilder(); requestExtensionBuilder.setSellerId(sellerId); requestExtensionBuilder.setHeaderBiddingType( headerBiddingEnabled ? HeaderBiddingType.HEADER_BIDDING_TYPE_ENABLED : HeaderBiddingType.HEADER_BIDDING_TYPE_DISABLED); requestExtensionBuilder.setBmIfv(bidMachine.obtainIFV(context)); requestBuilder.addExt(Any.pack(requestExtensionBuilder.build())); return requestBuilder.build(); }
AdRequest { @VisibleForTesting Object build(final android.content.Context context, AdsType adsType) { final String sellerId = BidMachineImpl.get().getSellerId(); if (TextUtils.isEmpty(sellerId)) { return BMError.paramError("Seller Id not provided"); } assert sellerId != null; BMError implVerifyError = verifyRequest(); if (implVerifyError != null) { return implVerifyError; } final BidMachineImpl bidMachine = BidMachineImpl.get(); AdvertisingPersonalData.syncUpdateInfo(context); final Request.Builder requestBuilder = Request.newBuilder(); final TargetingParams targetingParams = RequestParams.resolveParams(this.targetingParams, bidMachine.getTargetingParams()); final BlockedParams blockedParams = targetingParams.getBlockedParams(); final UserRestrictionParams userRestrictionParams = RequestParams.resolveParams(this.userRestrictionParams, bidMachine.getUserRestrictionParams()); unifiedAdRequestParams = createUnifiedAdRequestParams(targetingParams, userRestrictionParams); final PriceFloorParams priceFloorParams = oneOf(this.priceFloorParams, bidMachine.getPriceFloorParams()); final Map<String, Double> priceFloorsMap = priceFloorParams.getPriceFloors() == null || priceFloorParams.getPriceFloors().size() == 0 ? bidMachine.getPriceFloorParams().getPriceFloors() : priceFloorParams.getPriceFloors(); if (priceFloorsMap == null) { return BMError.paramError("PriceFloors not provided"); } final ArrayList<Message.Builder> placements = new ArrayList<>(); adsType.collectDisplayPlacements( new SimpleContextProvider(context), this, unifiedAdRequestParams, placements); final Request.Item.Builder itemBuilder = Request.Item.newBuilder(); itemBuilder.setId(UUID.randomUUID().toString()); itemBuilder.setQty(1); for (Map.Entry<String, Double> bid : priceFloorsMap.entrySet()) { final Request.Item.Deal.Builder dealBuilder = Request.Item.Deal.newBuilder(); dealBuilder.setId(bid.getKey()); dealBuilder.setFlr(bid.getValue()); dealBuilder.setFlrcur("USD"); itemBuilder.addDeal(dealBuilder); } final Placement.Builder placementBuilder = Placement.newBuilder(); placementBuilder.setSsai(0); placementBuilder.setSdk(BidMachine.NAME); placementBuilder.setSdkver(BidMachine.VERSION); placementBuilder.setSecure(!io.bidmachine.core.Utils.canUseCleartextTraffic()); for (Message.Builder displayBuilder : placements) { if (displayBuilder instanceof Placement.DisplayPlacement.Builder) { placementBuilder.setDisplay((Placement.DisplayPlacement.Builder) displayBuilder); } else if (displayBuilder instanceof Placement.VideoPlacement.Builder) { placementBuilder.setVideo((Placement.VideoPlacement.Builder) displayBuilder); } else { throw new IllegalArgumentException("Unsupported display type: " + displayBuilder); } } onBuildPlacement(placementBuilder); itemBuilder.setSpec(Any.pack(placementBuilder.build())); requestBuilder.addItem(itemBuilder.build()); final Context.Builder contextBuilder = Context.newBuilder(); final Context.App.Builder appBuilder = Context.App.newBuilder(); Publisher publisher = bidMachine.getPublisher(); if (publisher != null) { publisher.build(appBuilder); } targetingParams.build(context, appBuilder); contextBuilder.setApp(appBuilder); if (blockedParams != null) { final Context.Restrictions.Builder restrictionsBuilder = Context.Restrictions.newBuilder(); blockedParams.build(restrictionsBuilder); contextBuilder.setRestrictions(restrictionsBuilder); } final Context.User.Builder userBuilder = Context.User.newBuilder(); userRestrictionParams.build(userBuilder); if (userRestrictionParams.canSendUserInfo()) { targetingParams.build(userBuilder); } contextBuilder.setUser(userBuilder); final Context.Regs.Builder regsBuilder = Context.Regs.newBuilder(); userRestrictionParams.build(regsBuilder); contextBuilder.setRegs(regsBuilder); final Context.Device.Builder deviceBuilder = Context.Device.newBuilder(); bidMachine.getDeviceParams().build(context, deviceBuilder, targetingParams, bidMachine.getTargetingParams(), userRestrictionParams); contextBuilder.setDevice(deviceBuilder); requestBuilder.setContext(Any.pack(contextBuilder.build())); requestBuilder.setTest(bidMachine.isTestMode()); requestBuilder.addCur("USD"); requestBuilder.setAt(2); requestBuilder.setTmax(10000); final RequestExtension.Builder requestExtensionBuilder = RequestExtension.newBuilder(); requestExtensionBuilder.setSellerId(sellerId); requestExtensionBuilder.setHeaderBiddingType( headerBiddingEnabled ? HeaderBiddingType.HEADER_BIDDING_TYPE_ENABLED : HeaderBiddingType.HEADER_BIDDING_TYPE_DISABLED); requestExtensionBuilder.setBmIfv(bidMachine.obtainIFV(context)); requestBuilder.addExt(Any.pack(requestExtensionBuilder.build())); return requestBuilder.build(); } }
AdRequest { @VisibleForTesting Object build(final android.content.Context context, AdsType adsType) { final String sellerId = BidMachineImpl.get().getSellerId(); if (TextUtils.isEmpty(sellerId)) { return BMError.paramError("Seller Id not provided"); } assert sellerId != null; BMError implVerifyError = verifyRequest(); if (implVerifyError != null) { return implVerifyError; } final BidMachineImpl bidMachine = BidMachineImpl.get(); AdvertisingPersonalData.syncUpdateInfo(context); final Request.Builder requestBuilder = Request.newBuilder(); final TargetingParams targetingParams = RequestParams.resolveParams(this.targetingParams, bidMachine.getTargetingParams()); final BlockedParams blockedParams = targetingParams.getBlockedParams(); final UserRestrictionParams userRestrictionParams = RequestParams.resolveParams(this.userRestrictionParams, bidMachine.getUserRestrictionParams()); unifiedAdRequestParams = createUnifiedAdRequestParams(targetingParams, userRestrictionParams); final PriceFloorParams priceFloorParams = oneOf(this.priceFloorParams, bidMachine.getPriceFloorParams()); final Map<String, Double> priceFloorsMap = priceFloorParams.getPriceFloors() == null || priceFloorParams.getPriceFloors().size() == 0 ? bidMachine.getPriceFloorParams().getPriceFloors() : priceFloorParams.getPriceFloors(); if (priceFloorsMap == null) { return BMError.paramError("PriceFloors not provided"); } final ArrayList<Message.Builder> placements = new ArrayList<>(); adsType.collectDisplayPlacements( new SimpleContextProvider(context), this, unifiedAdRequestParams, placements); final Request.Item.Builder itemBuilder = Request.Item.newBuilder(); itemBuilder.setId(UUID.randomUUID().toString()); itemBuilder.setQty(1); for (Map.Entry<String, Double> bid : priceFloorsMap.entrySet()) { final Request.Item.Deal.Builder dealBuilder = Request.Item.Deal.newBuilder(); dealBuilder.setId(bid.getKey()); dealBuilder.setFlr(bid.getValue()); dealBuilder.setFlrcur("USD"); itemBuilder.addDeal(dealBuilder); } final Placement.Builder placementBuilder = Placement.newBuilder(); placementBuilder.setSsai(0); placementBuilder.setSdk(BidMachine.NAME); placementBuilder.setSdkver(BidMachine.VERSION); placementBuilder.setSecure(!io.bidmachine.core.Utils.canUseCleartextTraffic()); for (Message.Builder displayBuilder : placements) { if (displayBuilder instanceof Placement.DisplayPlacement.Builder) { placementBuilder.setDisplay((Placement.DisplayPlacement.Builder) displayBuilder); } else if (displayBuilder instanceof Placement.VideoPlacement.Builder) { placementBuilder.setVideo((Placement.VideoPlacement.Builder) displayBuilder); } else { throw new IllegalArgumentException("Unsupported display type: " + displayBuilder); } } onBuildPlacement(placementBuilder); itemBuilder.setSpec(Any.pack(placementBuilder.build())); requestBuilder.addItem(itemBuilder.build()); final Context.Builder contextBuilder = Context.newBuilder(); final Context.App.Builder appBuilder = Context.App.newBuilder(); Publisher publisher = bidMachine.getPublisher(); if (publisher != null) { publisher.build(appBuilder); } targetingParams.build(context, appBuilder); contextBuilder.setApp(appBuilder); if (blockedParams != null) { final Context.Restrictions.Builder restrictionsBuilder = Context.Restrictions.newBuilder(); blockedParams.build(restrictionsBuilder); contextBuilder.setRestrictions(restrictionsBuilder); } final Context.User.Builder userBuilder = Context.User.newBuilder(); userRestrictionParams.build(userBuilder); if (userRestrictionParams.canSendUserInfo()) { targetingParams.build(userBuilder); } contextBuilder.setUser(userBuilder); final Context.Regs.Builder regsBuilder = Context.Regs.newBuilder(); userRestrictionParams.build(regsBuilder); contextBuilder.setRegs(regsBuilder); final Context.Device.Builder deviceBuilder = Context.Device.newBuilder(); bidMachine.getDeviceParams().build(context, deviceBuilder, targetingParams, bidMachine.getTargetingParams(), userRestrictionParams); contextBuilder.setDevice(deviceBuilder); requestBuilder.setContext(Any.pack(contextBuilder.build())); requestBuilder.setTest(bidMachine.isTestMode()); requestBuilder.addCur("USD"); requestBuilder.setAt(2); requestBuilder.setTmax(10000); final RequestExtension.Builder requestExtensionBuilder = RequestExtension.newBuilder(); requestExtensionBuilder.setSellerId(sellerId); requestExtensionBuilder.setHeaderBiddingType( headerBiddingEnabled ? HeaderBiddingType.HEADER_BIDDING_TYPE_ENABLED : HeaderBiddingType.HEADER_BIDDING_TYPE_DISABLED); requestExtensionBuilder.setBmIfv(bidMachine.obtainIFV(context)); requestBuilder.addExt(Any.pack(requestExtensionBuilder.build())); return requestBuilder.build(); } protected  AdRequest(@NonNull AdsType adsType); }
AdRequest { @VisibleForTesting Object build(final android.content.Context context, AdsType adsType) { final String sellerId = BidMachineImpl.get().getSellerId(); if (TextUtils.isEmpty(sellerId)) { return BMError.paramError("Seller Id not provided"); } assert sellerId != null; BMError implVerifyError = verifyRequest(); if (implVerifyError != null) { return implVerifyError; } final BidMachineImpl bidMachine = BidMachineImpl.get(); AdvertisingPersonalData.syncUpdateInfo(context); final Request.Builder requestBuilder = Request.newBuilder(); final TargetingParams targetingParams = RequestParams.resolveParams(this.targetingParams, bidMachine.getTargetingParams()); final BlockedParams blockedParams = targetingParams.getBlockedParams(); final UserRestrictionParams userRestrictionParams = RequestParams.resolveParams(this.userRestrictionParams, bidMachine.getUserRestrictionParams()); unifiedAdRequestParams = createUnifiedAdRequestParams(targetingParams, userRestrictionParams); final PriceFloorParams priceFloorParams = oneOf(this.priceFloorParams, bidMachine.getPriceFloorParams()); final Map<String, Double> priceFloorsMap = priceFloorParams.getPriceFloors() == null || priceFloorParams.getPriceFloors().size() == 0 ? bidMachine.getPriceFloorParams().getPriceFloors() : priceFloorParams.getPriceFloors(); if (priceFloorsMap == null) { return BMError.paramError("PriceFloors not provided"); } final ArrayList<Message.Builder> placements = new ArrayList<>(); adsType.collectDisplayPlacements( new SimpleContextProvider(context), this, unifiedAdRequestParams, placements); final Request.Item.Builder itemBuilder = Request.Item.newBuilder(); itemBuilder.setId(UUID.randomUUID().toString()); itemBuilder.setQty(1); for (Map.Entry<String, Double> bid : priceFloorsMap.entrySet()) { final Request.Item.Deal.Builder dealBuilder = Request.Item.Deal.newBuilder(); dealBuilder.setId(bid.getKey()); dealBuilder.setFlr(bid.getValue()); dealBuilder.setFlrcur("USD"); itemBuilder.addDeal(dealBuilder); } final Placement.Builder placementBuilder = Placement.newBuilder(); placementBuilder.setSsai(0); placementBuilder.setSdk(BidMachine.NAME); placementBuilder.setSdkver(BidMachine.VERSION); placementBuilder.setSecure(!io.bidmachine.core.Utils.canUseCleartextTraffic()); for (Message.Builder displayBuilder : placements) { if (displayBuilder instanceof Placement.DisplayPlacement.Builder) { placementBuilder.setDisplay((Placement.DisplayPlacement.Builder) displayBuilder); } else if (displayBuilder instanceof Placement.VideoPlacement.Builder) { placementBuilder.setVideo((Placement.VideoPlacement.Builder) displayBuilder); } else { throw new IllegalArgumentException("Unsupported display type: " + displayBuilder); } } onBuildPlacement(placementBuilder); itemBuilder.setSpec(Any.pack(placementBuilder.build())); requestBuilder.addItem(itemBuilder.build()); final Context.Builder contextBuilder = Context.newBuilder(); final Context.App.Builder appBuilder = Context.App.newBuilder(); Publisher publisher = bidMachine.getPublisher(); if (publisher != null) { publisher.build(appBuilder); } targetingParams.build(context, appBuilder); contextBuilder.setApp(appBuilder); if (blockedParams != null) { final Context.Restrictions.Builder restrictionsBuilder = Context.Restrictions.newBuilder(); blockedParams.build(restrictionsBuilder); contextBuilder.setRestrictions(restrictionsBuilder); } final Context.User.Builder userBuilder = Context.User.newBuilder(); userRestrictionParams.build(userBuilder); if (userRestrictionParams.canSendUserInfo()) { targetingParams.build(userBuilder); } contextBuilder.setUser(userBuilder); final Context.Regs.Builder regsBuilder = Context.Regs.newBuilder(); userRestrictionParams.build(regsBuilder); contextBuilder.setRegs(regsBuilder); final Context.Device.Builder deviceBuilder = Context.Device.newBuilder(); bidMachine.getDeviceParams().build(context, deviceBuilder, targetingParams, bidMachine.getTargetingParams(), userRestrictionParams); contextBuilder.setDevice(deviceBuilder); requestBuilder.setContext(Any.pack(contextBuilder.build())); requestBuilder.setTest(bidMachine.isTestMode()); requestBuilder.addCur("USD"); requestBuilder.setAt(2); requestBuilder.setTmax(10000); final RequestExtension.Builder requestExtensionBuilder = RequestExtension.newBuilder(); requestExtensionBuilder.setSellerId(sellerId); requestExtensionBuilder.setHeaderBiddingType( headerBiddingEnabled ? HeaderBiddingType.HEADER_BIDDING_TYPE_ENABLED : HeaderBiddingType.HEADER_BIDDING_TYPE_DISABLED); requestExtensionBuilder.setBmIfv(bidMachine.obtainIFV(context)); requestBuilder.addExt(Any.pack(requestExtensionBuilder.build())); return requestBuilder.build(); } protected  AdRequest(@NonNull AdsType adsType); @Nullable @SuppressWarnings("WeakerAccess") AuctionResult getAuctionResult(); void request(@NonNull final android.content.Context context); void notifyMediationWin(); void notifyMediationLoss(); @SuppressWarnings("WeakerAccess") boolean isExpired(); @SuppressWarnings("WeakerAccess") void addListener(@Nullable AdRequestListener<SelfType> listener); @SuppressWarnings("WeakerAccess") void removeListener(@Nullable AdRequestListener<SelfType> listener); @NonNull @Override String toString(); }
AdRequest { @VisibleForTesting Object build(final android.content.Context context, AdsType adsType) { final String sellerId = BidMachineImpl.get().getSellerId(); if (TextUtils.isEmpty(sellerId)) { return BMError.paramError("Seller Id not provided"); } assert sellerId != null; BMError implVerifyError = verifyRequest(); if (implVerifyError != null) { return implVerifyError; } final BidMachineImpl bidMachine = BidMachineImpl.get(); AdvertisingPersonalData.syncUpdateInfo(context); final Request.Builder requestBuilder = Request.newBuilder(); final TargetingParams targetingParams = RequestParams.resolveParams(this.targetingParams, bidMachine.getTargetingParams()); final BlockedParams blockedParams = targetingParams.getBlockedParams(); final UserRestrictionParams userRestrictionParams = RequestParams.resolveParams(this.userRestrictionParams, bidMachine.getUserRestrictionParams()); unifiedAdRequestParams = createUnifiedAdRequestParams(targetingParams, userRestrictionParams); final PriceFloorParams priceFloorParams = oneOf(this.priceFloorParams, bidMachine.getPriceFloorParams()); final Map<String, Double> priceFloorsMap = priceFloorParams.getPriceFloors() == null || priceFloorParams.getPriceFloors().size() == 0 ? bidMachine.getPriceFloorParams().getPriceFloors() : priceFloorParams.getPriceFloors(); if (priceFloorsMap == null) { return BMError.paramError("PriceFloors not provided"); } final ArrayList<Message.Builder> placements = new ArrayList<>(); adsType.collectDisplayPlacements( new SimpleContextProvider(context), this, unifiedAdRequestParams, placements); final Request.Item.Builder itemBuilder = Request.Item.newBuilder(); itemBuilder.setId(UUID.randomUUID().toString()); itemBuilder.setQty(1); for (Map.Entry<String, Double> bid : priceFloorsMap.entrySet()) { final Request.Item.Deal.Builder dealBuilder = Request.Item.Deal.newBuilder(); dealBuilder.setId(bid.getKey()); dealBuilder.setFlr(bid.getValue()); dealBuilder.setFlrcur("USD"); itemBuilder.addDeal(dealBuilder); } final Placement.Builder placementBuilder = Placement.newBuilder(); placementBuilder.setSsai(0); placementBuilder.setSdk(BidMachine.NAME); placementBuilder.setSdkver(BidMachine.VERSION); placementBuilder.setSecure(!io.bidmachine.core.Utils.canUseCleartextTraffic()); for (Message.Builder displayBuilder : placements) { if (displayBuilder instanceof Placement.DisplayPlacement.Builder) { placementBuilder.setDisplay((Placement.DisplayPlacement.Builder) displayBuilder); } else if (displayBuilder instanceof Placement.VideoPlacement.Builder) { placementBuilder.setVideo((Placement.VideoPlacement.Builder) displayBuilder); } else { throw new IllegalArgumentException("Unsupported display type: " + displayBuilder); } } onBuildPlacement(placementBuilder); itemBuilder.setSpec(Any.pack(placementBuilder.build())); requestBuilder.addItem(itemBuilder.build()); final Context.Builder contextBuilder = Context.newBuilder(); final Context.App.Builder appBuilder = Context.App.newBuilder(); Publisher publisher = bidMachine.getPublisher(); if (publisher != null) { publisher.build(appBuilder); } targetingParams.build(context, appBuilder); contextBuilder.setApp(appBuilder); if (blockedParams != null) { final Context.Restrictions.Builder restrictionsBuilder = Context.Restrictions.newBuilder(); blockedParams.build(restrictionsBuilder); contextBuilder.setRestrictions(restrictionsBuilder); } final Context.User.Builder userBuilder = Context.User.newBuilder(); userRestrictionParams.build(userBuilder); if (userRestrictionParams.canSendUserInfo()) { targetingParams.build(userBuilder); } contextBuilder.setUser(userBuilder); final Context.Regs.Builder regsBuilder = Context.Regs.newBuilder(); userRestrictionParams.build(regsBuilder); contextBuilder.setRegs(regsBuilder); final Context.Device.Builder deviceBuilder = Context.Device.newBuilder(); bidMachine.getDeviceParams().build(context, deviceBuilder, targetingParams, bidMachine.getTargetingParams(), userRestrictionParams); contextBuilder.setDevice(deviceBuilder); requestBuilder.setContext(Any.pack(contextBuilder.build())); requestBuilder.setTest(bidMachine.isTestMode()); requestBuilder.addCur("USD"); requestBuilder.setAt(2); requestBuilder.setTmax(10000); final RequestExtension.Builder requestExtensionBuilder = RequestExtension.newBuilder(); requestExtensionBuilder.setSellerId(sellerId); requestExtensionBuilder.setHeaderBiddingType( headerBiddingEnabled ? HeaderBiddingType.HEADER_BIDDING_TYPE_ENABLED : HeaderBiddingType.HEADER_BIDDING_TYPE_DISABLED); requestExtensionBuilder.setBmIfv(bidMachine.obtainIFV(context)); requestBuilder.addExt(Any.pack(requestExtensionBuilder.build())); return requestBuilder.build(); } protected  AdRequest(@NonNull AdsType adsType); @Nullable @SuppressWarnings("WeakerAccess") AuctionResult getAuctionResult(); void request(@NonNull final android.content.Context context); void notifyMediationWin(); void notifyMediationLoss(); @SuppressWarnings("WeakerAccess") boolean isExpired(); @SuppressWarnings("WeakerAccess") void addListener(@Nullable AdRequestListener<SelfType> listener); @SuppressWarnings("WeakerAccess") void removeListener(@Nullable AdRequestListener<SelfType> listener); @NonNull @Override String toString();  }