From fcf1ccccfc767b2ca0e4a3c3d64140c70fdbe248 Mon Sep 17 00:00:00 2001 From: vladimanaev Date: Wed, 11 Nov 2020 10:25:34 +0200 Subject: [PATCH] Added campaign item focus, cta, policy review Added campaign browser targeting --- .../model/media/campaigns/Campaign.java | 15 ++-- .../media/campaigns/CampaignOperation.java | 5 ++ .../media/campaigns/items/CampaignItem.java | 69 +++++++++++++------ .../campaigns/items/CampaignItemCTA.java | 41 +++++++++++ .../items/CampaignItemCreativeFocus.java | 52 ++++++++++++++ .../items/CampaignItemOperation.java | 9 +++ .../items/CampaignItemPolicyReview.java | 45 ++++++++++++ .../model/media/campaigns/items/CtaType.java | 22 ++++++ .../campaigns/items/FocusCoordinates.java | 52 ++++++++++++++ .../media/campaigns/items/FocusType.java | 12 ++++ 10 files changed, 293 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCTA.java create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCreativeFocus.java create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemPolicyReview.java create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/CtaType.java create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusCoordinates.java create mode 100644 src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusType.java diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/Campaign.java b/src/main/java/com/taboola/backstage/model/media/campaigns/Campaign.java index 26b9366..cfa6e0a 100644 --- a/src/main/java/com/taboola/backstage/model/media/campaigns/Campaign.java +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/Campaign.java @@ -52,6 +52,7 @@ public class Campaign { protected CampaignTargeting osTargeting; protected CampaignTargeting connectionTypeTargeting; protected CampaignTargeting contextualTargeting; + protected CampaignTargeting browserTargeting; @ReadOnly protected CampaignTargeting postalCodeTargeting; @ReadOnly @@ -158,6 +159,10 @@ public CampaignTargeting getPostalCodeTargeting() { return postalCodeTargeting; } + public CampaignTargeting getBrowserTargeting() { + return browserTargeting; + } + public CampaignTargeting getOsTargeting() { return osTargeting; } @@ -305,6 +310,7 @@ public String toString() { ", osTargeting=" + osTargeting + ", connectionTypeTargeting=" + connectionTypeTargeting + ", contextualTargeting=" + contextualTargeting + + ", browserTargeting=" + browserTargeting + ", postalCodeTargeting=" + postalCodeTargeting + ", audienceSegmentsMultiTargeting=" + audienceSegmentsMultiTargeting + ", customAudienceTargeting=" + customAudienceTargeting + @@ -360,6 +366,7 @@ public boolean equals(Object o) { Objects.equals(osTargeting, campaign.osTargeting) && Objects.equals(connectionTypeTargeting, campaign.connectionTypeTargeting) && Objects.equals(contextualTargeting, campaign.contextualTargeting) && + Objects.equals(browserTargeting, campaign.browserTargeting) && Objects.equals(postalCodeTargeting, campaign.postalCodeTargeting) && Objects.equals(audienceSegmentsMultiTargeting, campaign.audienceSegmentsMultiTargeting) && Objects.equals(customAudienceTargeting, campaign.customAudienceTargeting) && @@ -387,12 +394,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, advertiserId, name, brandingText, trackingCode, cpc, dailyCap, dailyAdDeliveryModel, publisherBidModifier, - publisherBidStrategyModifiers, trafficAllocationMode, spendingLimit, spendingLimitModel, countryTargeting, - dmaCountryTargeting, regionCountryTargeting, subCountryTargeting, cityTargeting, platformTargeting, publisherTargeting, - autoPublisherTargeting, osTargeting, connectionTypeTargeting, contextualTargeting, postalCodeTargeting, - audienceSegmentsMultiTargeting, customAudienceTargeting, markingLabelMultiTargeting, lookalikeAudienceTargeting, comments, - bidType, marketingObjective, activitySchedule, startDate, endDate, startDateInUtc, endDateInUtc, approvalState, isActive, - spent, status, cpaGoal, pricingModel, externalBrandSafety, verificationPixel, viewabilityTag, policyReview); + return Objects.hash(id, advertiserId, name, brandingText, trackingCode, cpc, dailyCap, dailyAdDeliveryModel, publisherBidModifier, publisherBidStrategyModifiers, trafficAllocationMode, spendingLimit, spendingLimitModel, countryTargeting, dmaCountryTargeting, regionCountryTargeting, subCountryTargeting, cityTargeting, platformTargeting, publisherTargeting, autoPublisherTargeting, osTargeting, connectionTypeTargeting, contextualTargeting, browserTargeting, postalCodeTargeting, audienceSegmentsMultiTargeting, customAudienceTargeting, markingLabelMultiTargeting, lookalikeAudienceTargeting, comments, bidType, marketingObjective, activitySchedule, startDate, endDate, startDateInUtc, endDateInUtc, approvalState, isActive, spent, status, cpaGoal, pricingModel, externalBrandSafety, verificationPixel, viewabilityTag, policyReview); } } diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/CampaignOperation.java b/src/main/java/com/taboola/backstage/model/media/campaigns/CampaignOperation.java index d740cc2..5934ea1 100644 --- a/src/main/java/com/taboola/backstage/model/media/campaigns/CampaignOperation.java +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/CampaignOperation.java @@ -179,4 +179,9 @@ public CampaignOperation setVerificationPixel(VerificationPixel verificationPixe this.verificationPixel = verificationPixel; return this; } + + public CampaignOperation setBrowserTargeting(CampaignTargeting browserTargeting) { + this.browserTargeting = browserTargeting; + return this; + } } diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItem.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItem.java index 6e864b9..56034c3 100644 --- a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItem.java +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItem.java @@ -29,6 +29,10 @@ public class CampaignItem { @ReadOnly protected ItemStatus status; protected String description; + @ReadOnly + protected CampaignItemPolicyReview policyReview; + protected CampaignItemCTA cta; + protected CampaignItemCreativeFocus creativeFocus; public String getId() { return id; @@ -70,20 +74,39 @@ public String getDescription() { return description; } + public Boolean getActive() { + return isActive; + } + + public CampaignItemPolicyReview getPolicyReview() { + return policyReview; + } + + public CampaignItemCTA getCta() { + return cta; + } + + public CampaignItemCreativeFocus getCreativeFocus() { + return creativeFocus; + } + @Override public String toString() { return "CampaignItem{" + - "id='" + id + '\'' + - ", campaignId='" + campaignId + '\'' + - ", type='" + type + '\'' + - ", url='" + url + '\'' + - ", thumbnailUrl='" + thumbnailUrl + '\'' + - ", title='" + title + '\'' + - ", approvalState='" + approvalState + '\'' + - ", isActive=" + isActive + - ", status='" + status + '\'' + - ", description='" + description + '\'' + - '}'; + "id='" + id + '\'' + + ", campaignId='" + campaignId + '\'' + + ", type=" + type + + ", url='" + url + '\'' + + ", thumbnailUrl='" + thumbnailUrl + '\'' + + ", title='" + title + '\'' + + ", approvalState=" + approvalState + + ", isActive=" + isActive + + ", status=" + status + + ", description='" + description + '\'' + + ", policyReview=" + policyReview + + ", cta=" + cta + + ", creativeFocus=" + creativeFocus + + '}'; } @Override @@ -92,20 +115,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; CampaignItem that = (CampaignItem) o; return Objects.equals(id, that.id) && - Objects.equals(campaignId, that.campaignId) && - Objects.equals(type, that.type) && - Objects.equals(url, that.url) && - Objects.equals(thumbnailUrl, that.thumbnailUrl) && - Objects.equals(title, that.title) && - Objects.equals(approvalState, that.approvalState) && - Objects.equals(isActive, that.isActive) && - Objects.equals(status, that.status) && - Objects.equals(description, that.description); + Objects.equals(campaignId, that.campaignId) && + type == that.type && + Objects.equals(url, that.url) && + Objects.equals(thumbnailUrl, that.thumbnailUrl) && + Objects.equals(title, that.title) && + approvalState == that.approvalState && + Objects.equals(isActive, that.isActive) && + status == that.status && + Objects.equals(description, that.description) && + Objects.equals(policyReview, that.policyReview) && + Objects.equals(cta, that.cta) && + Objects.equals(creativeFocus, that.creativeFocus); } @Override public int hashCode() { - return Objects.hash(id, campaignId, type, url, thumbnailUrl, title, approvalState, isActive, status, - description); + return Objects.hash(id, campaignId, type, url, thumbnailUrl, title, approvalState, isActive, status, description, policyReview, cta, creativeFocus); } } diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCTA.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCTA.java new file mode 100644 index 0000000..077667b --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCTA.java @@ -0,0 +1,41 @@ +package com.taboola.backstage.model.media.campaigns.items; + +import java.util.Objects; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:52 + * Copyright Taboola + */ +public class CampaignItemCTA { + private CtaType ctaType; + + public CtaType getCtaType() { + return ctaType; + } + + public void setCtaType(CtaType ctaType) { + this.ctaType = ctaType; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CampaignItemCTA that = (CampaignItemCTA) o; + return Objects.equals(ctaType, that.ctaType); + } + + @Override + public int hashCode() { + return Objects.hash(ctaType); + } + + @Override + public String toString() { + return "CampaignItemCTA{" + + "ctaType=" + ctaType + + '}'; + } +} diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCreativeFocus.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCreativeFocus.java new file mode 100644 index 0000000..033d24b --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemCreativeFocus.java @@ -0,0 +1,52 @@ +package com.taboola.backstage.model.media.campaigns.items; + +import java.util.Objects; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:53 + * Copyright Taboola + */ +public class CampaignItemCreativeFocus { + private FocusType type; + private FocusCoordinates coordinates; + + public FocusType getType() { + return type; + } + + public void setType(FocusType type) { + this.type = type; + } + + public FocusCoordinates getCoordinates() { + return coordinates; + } + + public void setCoordinates(FocusCoordinates coordinates) { + this.coordinates = coordinates; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CampaignItemCreativeFocus that = (CampaignItemCreativeFocus) o; + return type == that.type && + Objects.equals(coordinates, that.coordinates); + } + + @Override + public int hashCode() { + return Objects.hash(type, coordinates); + } + + @Override + public String toString() { + return "CampaignItemCreativeFocus{" + + "type=" + type + + ", coordinates=" + coordinates + + '}'; + } +} diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemOperation.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemOperation.java index 9533bc0..ab166e8 100644 --- a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemOperation.java +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemOperation.java @@ -39,4 +39,13 @@ public CampaignItemOperation setDescription(String description) { return this; } + public CampaignItemOperation setCta(CampaignItemCTA cta) { + this.cta = cta; + return this; + } + + public CampaignItemOperation setCreativeFocus(CampaignItemCreativeFocus creativeFocus) { + this.creativeFocus = creativeFocus; + return this; + } } diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemPolicyReview.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemPolicyReview.java new file mode 100644 index 0000000..e7fc38c --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CampaignItemPolicyReview.java @@ -0,0 +1,45 @@ +package com.taboola.backstage.model.media.campaigns.items; + +import java.util.Objects; + +import com.taboola.backstage.annotations.ReadOnly; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:50 + * Copyright Taboola + */ +public class CampaignItemPolicyReview { + + @ReadOnly + private String rejectReason; + + public String getRejectReason() { + return rejectReason; + } + + public void setRejectReason(String rejectReason) { + this.rejectReason = rejectReason; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CampaignItemPolicyReview that = (CampaignItemPolicyReview) o; + return Objects.equals(rejectReason, that.rejectReason); + } + + @Override + public int hashCode() { + return Objects.hash(rejectReason); + } + + @Override + public String toString() { + return "CampaignItemPolicyReview{" + + "rejectReason='" + rejectReason + '\'' + + '}'; + } +} diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/CtaType.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CtaType.java new file mode 100644 index 0000000..ce92010 --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/CtaType.java @@ -0,0 +1,22 @@ +package com.taboola.backstage.model.media.campaigns.items; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:52 + * Copyright Taboola + */ +public enum CtaType { + DOWNLOAD, + INSTALL_NOW, + LEARN_MORE, + SHOP_NOW, + CLICK_HERE, + SIGN_UP, + PLAY_NOW, + READ_MORE, + GET_QUOTE, + GET_OFFER, + TRY_NOW, + NONE +} diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusCoordinates.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusCoordinates.java new file mode 100644 index 0000000..692708b --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusCoordinates.java @@ -0,0 +1,52 @@ +package com.taboola.backstage.model.media.campaigns.items; + +import java.util.Objects; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:54 + * Copyright Taboola + */ +public class FocusCoordinates { + private int x; + private int y; + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FocusCoordinates that = (FocusCoordinates) o; + return x == that.x && + y == that.y; + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + + @Override + public String toString() { + return "FocusCoordinates{" + + "x=" + x + + ", y=" + y + + '}'; + } +} diff --git a/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusType.java b/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusType.java new file mode 100644 index 0000000..aa60307 --- /dev/null +++ b/src/main/java/com/taboola/backstage/model/media/campaigns/items/FocusType.java @@ -0,0 +1,12 @@ +package com.taboola.backstage.model.media.campaigns.items; + +/** + * Created by vladi.m + * Date 11/11/2020 + * Time 9:54 + * Copyright Taboola + */ +public enum FocusType { + AUTOMATIC, + COORDINATES +}