-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
413 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/wildbit/java/postmark/client/data/model/webhooks/HttpAuth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.wildbit.java.postmark.client.data.model.webhooks; | ||
|
||
public class HttpAuth { | ||
private String username; | ||
private String password; | ||
|
||
public HttpAuth() { | ||
} | ||
|
||
public HttpAuth(String username, String password) { | ||
this.username = username; | ||
this.password = password; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
src/main/java/com/wildbit/java/postmark/client/data/model/webhooks/Webhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.wildbit.java.postmark.client.data.model.webhooks; | ||
|
||
import com.wildbit.java.postmark.client.data.model.message.Header; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Webhook { | ||
private Integer id; | ||
private String url; | ||
private HttpAuth httpAuth; | ||
private List<Header> httpHeaders; | ||
private String messageStream; | ||
private WebhookTriggers triggers; | ||
|
||
public Webhook() { | ||
} | ||
|
||
public Webhook(String url) { | ||
this.url = url; | ||
} | ||
|
||
public Webhook(String url, WebhookTriggers triggers) { | ||
this.url = url; | ||
this.triggers = triggers; | ||
} | ||
|
||
public Webhook(String url, HttpAuth httpAuth, WebhookTriggers triggers) { | ||
this.url = url; | ||
this.triggers = triggers; | ||
this.httpAuth = httpAuth; | ||
} | ||
|
||
public Webhook(String url, HttpAuth httpAuth, WebhookTriggers triggers, List<Header> httpHeaders) { | ||
this.url = url; | ||
this.triggers = triggers; | ||
this.httpAuth = httpAuth; | ||
this.httpHeaders = httpHeaders; | ||
} | ||
|
||
public void addHeader(String name, String value) { | ||
if (this.httpHeaders == null) { | ||
setHttpHeaders(new ArrayList<>()); | ||
} | ||
this.httpHeaders.add(new Header(name,value)); | ||
} | ||
|
||
public void clearHeaders() { | ||
if (this.httpHeaders != null) { | ||
this.httpHeaders.clear(); | ||
} | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public HttpAuth getHttpAuth() { | ||
return httpAuth; | ||
} | ||
|
||
public void setHttpAuth(HttpAuth httpAuth) { | ||
this.httpAuth = httpAuth; | ||
} | ||
|
||
public List<Header> getHttpHeaders() { | ||
return httpHeaders; | ||
} | ||
|
||
public void setHttpHeaders(List<Header> httpHeaders) { | ||
this.httpHeaders = httpHeaders; | ||
} | ||
|
||
public String getMessageStream() { | ||
return messageStream; | ||
} | ||
|
||
public void setMessageStream(String messageStream) { | ||
this.messageStream = messageStream; | ||
} | ||
|
||
public WebhookTriggers getTriggers() { | ||
return triggers; | ||
} | ||
|
||
public void setTriggers(WebhookTriggers triggers) { | ||
this.triggers = triggers; | ||
} | ||
} | ||
|
89 changes: 89 additions & 0 deletions
89
src/main/java/com/wildbit/java/postmark/client/data/model/webhooks/WebhookTriggers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.wildbit.java.postmark.client.data.model.webhooks; | ||
|
||
import com.wildbit.java.postmark.client.data.model.webhooks.triggers.*; | ||
|
||
public class WebhookTriggers { | ||
private OpenWebhookTrigger open; | ||
private WebhookTrigger click; | ||
private WebhookTrigger delivery; | ||
private BounceWebhookTrigger bounce; | ||
private SpamWebhookTrigger spamComplaint; | ||
|
||
public WebhookTriggers() { | ||
this.open = new OpenWebhookTrigger(false); | ||
this.click = new WebhookTrigger(false); | ||
this.delivery = new WebhookTrigger(false); | ||
this.bounce = new BounceWebhookTrigger(false); | ||
this.spamComplaint = new SpamWebhookTrigger(false); | ||
} | ||
|
||
public WebhookTriggers(boolean openEnabled, boolean clickEnabled) { | ||
this.open = new OpenWebhookTrigger(openEnabled); | ||
this.click = new WebhookTrigger(clickEnabled); | ||
} | ||
|
||
public WebhookTriggers(boolean openEnabled, boolean clickEnabled, | ||
boolean bounceEnabled) { | ||
this.open = new OpenWebhookTrigger(openEnabled); | ||
this.click = new WebhookTrigger(clickEnabled); | ||
this.bounce = new BounceWebhookTrigger(bounceEnabled); | ||
} | ||
|
||
public WebhookTriggers(boolean openEnabled, boolean clickEnabled, | ||
boolean bounceEnabled, boolean spamComplaintEnabled, boolean deliveryEnabled) { | ||
this.open = new OpenWebhookTrigger(openEnabled); | ||
this.click = new WebhookTrigger(clickEnabled); | ||
this.delivery = new WebhookTrigger(deliveryEnabled); | ||
this.bounce = new BounceWebhookTrigger(bounceEnabled); | ||
this.spamComplaint = new SpamWebhookTrigger(spamComplaintEnabled); | ||
} | ||
|
||
public WebhookTriggers(OpenWebhookTrigger open, WebhookTrigger click, WebhookTrigger delivery, | ||
BounceWebhookTrigger bounce, SpamWebhookTrigger spamComplaint) { | ||
this.open = open; | ||
this.click = click; | ||
this.delivery = delivery; | ||
this.bounce = bounce; | ||
this.spamComplaint = spamComplaint; | ||
} | ||
|
||
public OpenWebhookTrigger getOpen() { | ||
return open; | ||
} | ||
|
||
public void setOpen(OpenWebhookTrigger open) { | ||
this.open = open; | ||
} | ||
|
||
public WebhookTrigger getClick() { | ||
return click; | ||
} | ||
|
||
public void setClick(WebhookTrigger click) { | ||
this.click = click; | ||
} | ||
|
||
public WebhookTrigger getDelivery() { | ||
return delivery; | ||
} | ||
|
||
public void setDelivery(WebhookTrigger delivery) { | ||
this.delivery = delivery; | ||
} | ||
|
||
public BounceWebhookTrigger getBounce() { | ||
return bounce; | ||
} | ||
|
||
public void setBounce(BounceWebhookTrigger bounce) { | ||
this.bounce = bounce; | ||
} | ||
|
||
public SpamWebhookTrigger getSpamComplaint() { | ||
return spamComplaint; | ||
} | ||
|
||
public void setSpamComplaint(SpamWebhookTrigger spamComplaint) { | ||
this.spamComplaint = spamComplaint; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/wildbit/java/postmark/client/data/model/webhooks/Webhooks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.wildbit.java.postmark.client.data.model.webhooks; | ||
|
||
import java.util.List; | ||
|
||
public class Webhooks { | ||
private List<Webhook> webhooks; | ||
|
||
public List<Webhook> getWebhooks() { | ||
return webhooks; | ||
} | ||
|
||
public void setWebhooks(List<Webhook> webhooks) { | ||
this.webhooks = webhooks; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...nt/data/model/webhooks/BounceWebhook.java → .../webhooks/sent_payload/BounceWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ent/data/model/webhooks/ClickWebhook.java → ...l/webhooks/sent_payload/ClickWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../data/model/webhooks/DeliveryWebhook.java → ...ebhooks/sent_payload/DeliveryWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/data/model/webhooks/InboundWebhook.java → ...webhooks/sent_payload/InboundWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ient/data/model/webhooks/OpenWebhook.java → ...el/webhooks/sent_payload/OpenWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...a/com/wildbit/java/postmark/client/data/model/webhooks/triggers/BounceWebhookTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.wildbit.java.postmark.client.data.model.webhooks.triggers; | ||
|
||
public class BounceWebhookTrigger extends WebhookTrigger { | ||
private boolean includeContent; | ||
|
||
public BounceWebhookTrigger() { | ||
super(); | ||
} | ||
|
||
public BounceWebhookTrigger(boolean enabled) { | ||
super(enabled); | ||
} | ||
|
||
public BounceWebhookTrigger(boolean enabled, boolean includeContent) { | ||
super(enabled); | ||
this.includeContent = includeContent; | ||
} | ||
|
||
public boolean isIncludeContent() { | ||
return includeContent; | ||
} | ||
|
||
public void setIncludeContent(boolean includeContent) { | ||
this.includeContent = includeContent; | ||
} | ||
} |
Oops, something went wrong.