-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
fd0eb5c
commit 1f6c130
Showing
12 changed files
with
496 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,9 @@ public enum HttpMethod { | |
* HTTP DELETE method. | ||
*/ | ||
DELETE, | ||
|
||
/** | ||
* HTTP PATCH method. | ||
*/ | ||
PATCH, | ||
} |
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
133 changes: 133 additions & 0 deletions
133
src/main/java/com/resend/services/contacts/model/ContactOptions.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,133 @@ | ||
package com.resend.services.contacts.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Common superclass for contact options. | ||
*/ | ||
public abstract class ContactOptions { | ||
|
||
/** | ||
* The id of the contact options | ||
*/ | ||
@JsonProperty("id") | ||
protected final String id; | ||
|
||
/** | ||
* The audience_id of the contact options | ||
*/ | ||
@JsonProperty("audience_id") | ||
protected final String audienceId; | ||
|
||
/** | ||
* The email of the contact options | ||
*/ | ||
@JsonProperty("email") | ||
protected final String email; | ||
|
||
/** | ||
* Constructs a ContactOptions object using the provided builder. | ||
* | ||
* @param builder The builder to construct the ContactOptions. | ||
*/ | ||
protected ContactOptions(Builder builder) { | ||
this.id = builder.id; | ||
this.audienceId = builder.audienceId; | ||
this.email = builder.email; | ||
} | ||
|
||
/** | ||
* Get the id of the ContactOptions. | ||
* | ||
* @return The id of the ContactOptions. | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* Get the audienceId of the ContactOptions. | ||
* | ||
* @return The audienceId of the ContactOptions. | ||
*/ | ||
public String getAudienceId() { | ||
return audienceId; | ||
} | ||
|
||
/** | ||
* Get the email of the ContactOptions. | ||
* | ||
* @return The email of the ContactOptions. | ||
*/ | ||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
/** | ||
* Common builder class for constructing ContactOptions objects. | ||
*/ | ||
protected static abstract class Builder<T extends ContactOptions, B extends Builder<T, B>> { | ||
/** | ||
* The id of the contact options builder | ||
*/ | ||
protected String id; | ||
|
||
/** | ||
* The audienceId of the contact options builder | ||
*/ | ||
protected String audienceId; | ||
|
||
/** | ||
* The email of the contact options builder | ||
*/ | ||
protected String email; | ||
|
||
/** | ||
* Set the id of the ContactOptions. | ||
* | ||
* @param id The id of the ContactOptions. | ||
* @return The builder instance. | ||
*/ | ||
public B id(String id) { | ||
this.id = id; | ||
return self(); | ||
} | ||
|
||
/** | ||
* Set the audienceId of the ContactOptions. | ||
* | ||
* @param audienceId The audienceId of the ContactOptions. | ||
* @return The builder instance. | ||
*/ | ||
public B audienceId(String audienceId) { | ||
this.audienceId = audienceId; | ||
return self(); | ||
} | ||
|
||
/** | ||
* Set the email of the ContactOptions. | ||
* | ||
* @param email The email of the ContactOptions. | ||
* @return The builder instance. | ||
*/ | ||
public B email(String email) { | ||
this.email = email; | ||
return self(); | ||
} | ||
|
||
/** | ||
* Abstract method to be implemented by subclasses to create an instance of the corresponding ContactOptions class. | ||
* | ||
* @return A new ContactOptions object. | ||
*/ | ||
public abstract T build(); | ||
|
||
/** | ||
* Abstract method to be implemented by subclasses to return the builder instance (used for self-referencing in methods). | ||
* | ||
* @return The builder instance. | ||
*/ | ||
protected abstract B self(); | ||
} | ||
} | ||
|
88 changes: 0 additions & 88 deletions
88
src/main/java/com/resend/services/contacts/model/ContactRequestOptions.java
This file was deleted.
Oops, something went wrong.
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
51 changes: 51 additions & 0 deletions
51
src/main/java/com/resend/services/contacts/model/GetContactOptions.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,51 @@ | ||
package com.resend.services.contacts.model; | ||
|
||
/** | ||
* Class representing options to get a contact. | ||
*/ | ||
public class GetContactOptions extends ContactOptions { | ||
|
||
/** | ||
* Constructs a GetContactOptions object using the provided builder. | ||
* | ||
* @param builder The builder to construct the GetContactOptions. | ||
*/ | ||
public GetContactOptions(Builder builder) { | ||
super(builder); | ||
} | ||
|
||
/** | ||
* Create a new builder instance for constructing GetContactOptions objects. | ||
* | ||
* @return A new builder instance. | ||
*/ | ||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
/** | ||
* Builder class for constructing GetContactOptions objects. | ||
*/ | ||
public static class Builder extends ContactOptions.Builder<GetContactOptions, Builder> { | ||
|
||
/** | ||
* Build a new GetContactOptions object. | ||
* | ||
* @return A new GetContactOptions object. | ||
*/ | ||
@Override | ||
public GetContactOptions build() { | ||
return new GetContactOptions(this); | ||
} | ||
|
||
/** | ||
* Return the builder instance. | ||
* | ||
* @return The builder instance. | ||
*/ | ||
@Override | ||
protected Builder self() { | ||
return this; | ||
} | ||
} | ||
} |
Oops, something went wrong.