com.mailgun.model.mailing.lists.MailingListRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mailgun-java Show documentation
Show all versions of mailgun-java Show documentation
The Mailgun SDK for Java enables Java developers to work with Mailgun API
efficiently.
The newest version!
package com.mailgun.model.mailing.lists;
import com.mailgun.enums.AccessLevel;
import com.mailgun.enums.ReplyPreference;
import feign.form.FormProperty;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
/**
*
* Mailgun lists request.
*
*
* @see Mailing Lists
*/
@Getter
@ToString
@EqualsAndHashCode
@Builder
public class MailingListRequest {
/**
*
* A valid email address for the mailing list, e.g. [email protected]
, or Developers [email protected]
.
*
*/
String address;
/**
*
* Mailing list name, e.g. Developers
(optional).
*
*/
String name;
/**
*
* A description (optional).
*
*/
String description;
/**
*
* List access level, one of: READONLY
(default), MEMBERS
, EVERYONE
.
*
*/
@FormProperty("access_level")
String accessLevel;
/**
*
* Set where replies should go: list
(default) | sender
(optional).
*
*/
@FormProperty("reply_preference")
String replyPreference;
public static class MailingListRequestBuilder {
/**
*
* List access level, one of: READONLY
(default), MEMBERS
, EVERYONE
.
*
*
* @param accessLevel {@link AccessLevel}
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MailingListRequest.MailingListRequestBuilder accessLevel(AccessLevel accessLevel) {
this.accessLevel = accessLevel.getValue();
return this;
}
/**
*
* Set where replies should go: list
(default) | sender
(optional).
*
*
* @param replyPreference {@link ReplyPreference}
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MailingListRequest.MailingListRequestBuilder replyPreference(ReplyPreference replyPreference) {
this.replyPreference = replyPreference.getValue();
return this;
}
}
}