Skip to content

Commit

Permalink
Added campaign item focus, cta, policy review
Browse files Browse the repository at this point in the history
Added campaign browser targeting
  • Loading branch information
vladimanaev committed Nov 11, 2020
1 parent 89e5c4a commit fcf1ccc
Show file tree
Hide file tree
Showing 10 changed files with 293 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class Campaign {
protected CampaignTargeting<OperationSystem> osTargeting;
protected CampaignTargeting<ConnectionType> connectionTypeTargeting;
protected CampaignTargeting<String> contextualTargeting;
protected CampaignTargeting<String> browserTargeting;
@ReadOnly
protected CampaignTargeting<String> postalCodeTargeting;
@ReadOnly
Expand Down Expand Up @@ -158,6 +159,10 @@ public CampaignTargeting<String> getPostalCodeTargeting() {
return postalCodeTargeting;
}

public CampaignTargeting<String> getBrowserTargeting() {
return browserTargeting;
}

public CampaignTargeting<OperationSystem> getOsTargeting() {
return osTargeting;
}
Expand Down Expand Up @@ -305,6 +310,7 @@ public String toString() {
", osTargeting=" + osTargeting +
", connectionTypeTargeting=" + connectionTypeTargeting +
", contextualTargeting=" + contextualTargeting +
", browserTargeting=" + browserTargeting +
", postalCodeTargeting=" + postalCodeTargeting +
", audienceSegmentsMultiTargeting=" + audienceSegmentsMultiTargeting +
", customAudienceTargeting=" + customAudienceTargeting +
Expand Down Expand Up @@ -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) &&
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,9 @@ public CampaignOperation setVerificationPixel(VerificationPixel verificationPixe
this.verificationPixel = verificationPixel;
return this;
}

public CampaignOperation setBrowserTargeting(CampaignTargeting<String> browserTargeting) {
this.browserTargeting = browserTargeting;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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 +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -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 +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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 + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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 +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit fcf1ccc

Please sign in to comment.