-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ogury: port new adapter from Go #3788
base: master
Are you sure you want to change the base?
Ogury: port new adapter from Go #3788
Conversation
if (request == null || CollectionUtils.isEmpty(request.getImp())) { | ||
errors.add(BidderError.badInput("There are no valid impressions to create bid request to ogury bidder")); | ||
return Result.withErrors(errors); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this checks
private List<Imp> modifyImps(BidRequest request, Consumer<Imp> impWithOguryParamsHandler) { | ||
return Optional.of(request) | ||
.map(BidRequest::getImp) | ||
.map(sourceImps -> sourceImps.stream().map(imp -> { | ||
final ObjectNode impExt = resolveImpExt(imp); | ||
final ObjectNode impExtBidderHoist = resolveImpExtBidderHoist(impExt); | ||
|
||
final ObjectNode modifiedImpExt = modifyImpExt(impExt, impExtBidderHoist); | ||
final BigDecimal bidFloor = resolveBidFloor(request, imp); | ||
final Imp modifiedImp = modifyImp(imp, bidFloor, modifiedImpExt); | ||
|
||
if (hasOguryParams(impExtBidderHoist)) { | ||
impWithOguryParamsHandler.accept(modifiedImp); | ||
} | ||
|
||
return modifiedImp; | ||
})) | ||
.map(Stream::toList).orElse(null); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, see examples how to iterate over imps in other adapters
See https://github.com/prebid/prebid-server-java/pull/3768/files as a starting point
🔧 Type of changes
✨ What's the context?
New Ogury adapter (Port PR from PBS-Go)
#3700
🧠 Rationale behind the change
Why did you choose to make these changes? Were there any trade-offs you had to consider?
🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
Unit tests with decent coverage
🏎 Quality check