/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk.models.operations;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.utils.LazySingletonValue;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Deprecated;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;

/**
 * PostUsersSignInDataUserPlexAccount - Returns the user account data with a valid auth token
 */

public class PostUsersSignInDataUserPlexAccount {

    /**
     * Unknown
     */
    @JsonInclude(Include.ALWAYS)
    @JsonProperty("adsConsent")
    private Optional<Boolean> adsConsent;

    @JsonInclude(Include.ALWAYS)
    @JsonProperty("adsConsentReminderAt")
    private Optional<Long> adsConsentReminderAt;

    @JsonInclude(Include.ALWAYS)
    @JsonProperty("adsConsentSetAt")
    private Optional<Long> adsConsentSetAt;

    /**
     * Unknown
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("anonymous")
    private JsonNullable<Boolean> anonymous;

    /**
     * The account token
     */
    @JsonProperty("authToken")
    private String authToken;

    /**
     * If the two-factor authentication backup codes have been created
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("backupCodesCreated")
    private Optional<Boolean> backupCodesCreated;

    /**
     * If the account has been confirmed
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("confirmed")
    private Optional<Boolean> confirmed;

    /**
     * The account country
     */
    @JsonProperty("country")
    private String country;

    /**
     * The account email address
     */
    @JsonProperty("email")
    private String email;

    /**
     * If login with email only is enabled
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("emailOnlyAuth")
    private Optional<Boolean> emailOnlyAuth;

    /**
     * If experimental features are enabled
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("experimentalFeatures")
    private Optional<Boolean> experimentalFeatures;

    /**
     * Your account full name
     */
    @JsonProperty("friendlyName")
    private String friendlyName;

    /**
     * List of devices your allowed to use with this account
     */
    @JsonProperty("entitlements")
    private List<String> entitlements;

    /**
     * If the account is a Plex Home guest user
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("guest")
    private Optional<Boolean> guest;

    /**
     * If the account has a password
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("hasPassword")
    private Optional<Boolean> hasPassword;

    /**
     * If the account is a Plex Home user
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("home")
    private Optional<Boolean> home;

    /**
     * If the account is the Plex Home admin
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("homeAdmin")
    private Optional<Boolean> homeAdmin;

    /**
     * The number of accounts in the Plex Home
     */
    @JsonProperty("homeSize")
    private int homeSize;

    /**
     * The Plex account ID
     */
    @JsonProperty("id")
    private int id;

    /**
     * Unix epoch datetime in seconds
     */
    @JsonProperty("joinedAt")
    private long joinedAt;

    /**
     * The account locale
     */
    @JsonInclude(Include.ALWAYS)
    @JsonProperty("locale")
    private Optional<String> locale;

    /**
     * If you are subscribed to the Plex newsletter
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("mailingListActive")
    private Optional<Boolean> mailingListActive;

    /**
     * Your current mailing list status (active or unsubscribed)
     */
    @JsonProperty("mailingListStatus")
    private PostUsersSignInDataMailingListStatus mailingListStatus;

    /**
     * The maximum number of accounts allowed in the Plex Home
     */
    @JsonProperty("maxHomeSize")
    private int maxHomeSize;

    /**
     * [Might be removed] The hashed Plex Home PIN 
     * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("pin")
    @Deprecated
    private Optional<String> pin;

    @JsonProperty("profile")
    private PostUsersSignInDataUserProfile profile;

    /**
     * If the account has a Plex Home PIN enabled
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("protected")
    private Optional<Boolean> protected_;

    /**
     * Unix epoch datetime in seconds
     */
    @JsonProperty("rememberExpiresAt")
    private long rememberExpiresAt;

    /**
     * If the account is a Plex Home managed user
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("restricted")
    private Optional<Boolean> restricted;

    /**
     * [Might be removed] List of account roles. Plexpass membership listed here
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("roles")
    private Optional<? extends List<String>> roles;

    /**
     * Unknown
     */
    @JsonProperty("scrobbleTypes")
    private String scrobbleTypes;

    @JsonProperty("services")
    private List<PostUsersSignInDataServices> services;

    /**
     * If the account’s Plex Pass subscription is active
     */
    @JsonProperty("subscription")
    private PostUsersSignInDataSubscription subscription;

    /**
     * Description of the Plex Pass subscription
     */
    @JsonInclude(Include.ALWAYS)
    @JsonProperty("subscriptionDescription")
    private Optional<String> subscriptionDescription;

    @JsonProperty("subscriptions")
    private List<PostUsersSignInDataAuthenticationSubscription> subscriptions;

    /**
     * URL of the account thumbnail
     */
    @JsonProperty("thumb")
    private String thumb;

    /**
     * The title of the account (username or friendly name)
     */
    @JsonProperty("title")
    private String title;

    /**
     * If two-factor authentication is enabled
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("twoFactorEnabled")
    private Optional<Boolean> twoFactorEnabled;

    /**
     * The account username
     */
    @JsonProperty("username")
    private String username;

    /**
     * The account UUID
     */
    @JsonProperty("uuid")
    private String uuid;

    @JsonInclude(Include.ALWAYS)
    @JsonProperty("attributionPartner")
    private Optional<String> attributionPartner;

    @JsonProperty("pastSubscriptions")
    private List<PastSubscription> pastSubscriptions;

    @JsonProperty("trials")
    private List<Trials> trials;

    @JsonCreator
    public PostUsersSignInDataUserPlexAccount(
            @JsonProperty("adsConsent") Optional<Boolean> adsConsent,
            @JsonProperty("adsConsentReminderAt") Optional<Long> adsConsentReminderAt,
            @JsonProperty("adsConsentSetAt") Optional<Long> adsConsentSetAt,
            @JsonProperty("anonymous") JsonNullable<Boolean> anonymous,
            @JsonProperty("authToken") String authToken,
            @JsonProperty("backupCodesCreated") Optional<Boolean> backupCodesCreated,
            @JsonProperty("confirmed") Optional<Boolean> confirmed,
            @JsonProperty("country") String country,
            @JsonProperty("email") String email,
            @JsonProperty("emailOnlyAuth") Optional<Boolean> emailOnlyAuth,
            @JsonProperty("experimentalFeatures") Optional<Boolean> experimentalFeatures,
            @JsonProperty("friendlyName") String friendlyName,
            @JsonProperty("entitlements") List<String> entitlements,
            @JsonProperty("guest") Optional<Boolean> guest,
            @JsonProperty("hasPassword") Optional<Boolean> hasPassword,
            @JsonProperty("home") Optional<Boolean> home,
            @JsonProperty("homeAdmin") Optional<Boolean> homeAdmin,
            @JsonProperty("homeSize") int homeSize,
            @JsonProperty("id") int id,
            @JsonProperty("joinedAt") long joinedAt,
            @JsonProperty("locale") Optional<String> locale,
            @JsonProperty("mailingListActive") Optional<Boolean> mailingListActive,
            @JsonProperty("mailingListStatus") PostUsersSignInDataMailingListStatus mailingListStatus,
            @JsonProperty("maxHomeSize") int maxHomeSize,
            @JsonProperty("pin") Optional<String> pin,
            @JsonProperty("profile") PostUsersSignInDataUserProfile profile,
            @JsonProperty("protected") Optional<Boolean> protected_,
            @JsonProperty("rememberExpiresAt") long rememberExpiresAt,
            @JsonProperty("restricted") Optional<Boolean> restricted,
            @JsonProperty("roles") Optional<? extends List<String>> roles,
            @JsonProperty("scrobbleTypes") String scrobbleTypes,
            @JsonProperty("services") List<PostUsersSignInDataServices> services,
            @JsonProperty("subscription") PostUsersSignInDataSubscription subscription,
            @JsonProperty("subscriptionDescription") Optional<String> subscriptionDescription,
            @JsonProperty("subscriptions") List<PostUsersSignInDataAuthenticationSubscription> subscriptions,
            @JsonProperty("thumb") String thumb,
            @JsonProperty("title") String title,
            @JsonProperty("twoFactorEnabled") Optional<Boolean> twoFactorEnabled,
            @JsonProperty("username") String username,
            @JsonProperty("uuid") String uuid,
            @JsonProperty("attributionPartner") Optional<String> attributionPartner,
            @JsonProperty("pastSubscriptions") List<PastSubscription> pastSubscriptions,
            @JsonProperty("trials") List<Trials> trials) {
        Utils.checkNotNull(adsConsent, "adsConsent");
        Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
        Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
        Utils.checkNotNull(anonymous, "anonymous");
        Utils.checkNotNull(authToken, "authToken");
        Utils.checkNotNull(backupCodesCreated, "backupCodesCreated");
        Utils.checkNotNull(confirmed, "confirmed");
        Utils.checkNotNull(country, "country");
        Utils.checkNotNull(email, "email");
        Utils.checkNotNull(emailOnlyAuth, "emailOnlyAuth");
        Utils.checkNotNull(experimentalFeatures, "experimentalFeatures");
        Utils.checkNotNull(friendlyName, "friendlyName");
        Utils.checkNotNull(entitlements, "entitlements");
        Utils.checkNotNull(guest, "guest");
        Utils.checkNotNull(hasPassword, "hasPassword");
        Utils.checkNotNull(home, "home");
        Utils.checkNotNull(homeAdmin, "homeAdmin");
        Utils.checkNotNull(homeSize, "homeSize");
        Utils.checkNotNull(id, "id");
        Utils.checkNotNull(joinedAt, "joinedAt");
        Utils.checkNotNull(locale, "locale");
        Utils.checkNotNull(mailingListActive, "mailingListActive");
        Utils.checkNotNull(mailingListStatus, "mailingListStatus");
        Utils.checkNotNull(maxHomeSize, "maxHomeSize");
        Utils.checkNotNull(pin, "pin");
        Utils.checkNotNull(profile, "profile");
        Utils.checkNotNull(protected_, "protected_");
        Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt");
        Utils.checkNotNull(restricted, "restricted");
        Utils.checkNotNull(roles, "roles");
        Utils.checkNotNull(scrobbleTypes, "scrobbleTypes");
        Utils.checkNotNull(services, "services");
        Utils.checkNotNull(subscription, "subscription");
        Utils.checkNotNull(subscriptionDescription, "subscriptionDescription");
        Utils.checkNotNull(subscriptions, "subscriptions");
        Utils.checkNotNull(thumb, "thumb");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled");
        Utils.checkNotNull(username, "username");
        Utils.checkNotNull(uuid, "uuid");
        Utils.checkNotNull(attributionPartner, "attributionPartner");
        Utils.checkNotNull(pastSubscriptions, "pastSubscriptions");
        Utils.checkNotNull(trials, "trials");
        this.adsConsent = adsConsent;
        this.adsConsentReminderAt = adsConsentReminderAt;
        this.adsConsentSetAt = adsConsentSetAt;
        this.anonymous = anonymous;
        this.authToken = authToken;
        this.backupCodesCreated = backupCodesCreated;
        this.confirmed = confirmed;
        this.country = country;
        this.email = email;
        this.emailOnlyAuth = emailOnlyAuth;
        this.experimentalFeatures = experimentalFeatures;
        this.friendlyName = friendlyName;
        this.entitlements = entitlements;
        this.guest = guest;
        this.hasPassword = hasPassword;
        this.home = home;
        this.homeAdmin = homeAdmin;
        this.homeSize = homeSize;
        this.id = id;
        this.joinedAt = joinedAt;
        this.locale = locale;
        this.mailingListActive = mailingListActive;
        this.mailingListStatus = mailingListStatus;
        this.maxHomeSize = maxHomeSize;
        this.pin = pin;
        this.profile = profile;
        this.protected_ = protected_;
        this.rememberExpiresAt = rememberExpiresAt;
        this.restricted = restricted;
        this.roles = roles;
        this.scrobbleTypes = scrobbleTypes;
        this.services = services;
        this.subscription = subscription;
        this.subscriptionDescription = subscriptionDescription;
        this.subscriptions = subscriptions;
        this.thumb = thumb;
        this.title = title;
        this.twoFactorEnabled = twoFactorEnabled;
        this.username = username;
        this.uuid = uuid;
        this.attributionPartner = attributionPartner;
        this.pastSubscriptions = pastSubscriptions;
        this.trials = trials;
    }
    
    public PostUsersSignInDataUserPlexAccount(
            String authToken,
            String country,
            String email,
            String friendlyName,
            List<String> entitlements,
            int homeSize,
            int id,
            long joinedAt,
            PostUsersSignInDataMailingListStatus mailingListStatus,
            int maxHomeSize,
            PostUsersSignInDataUserProfile profile,
            long rememberExpiresAt,
            String scrobbleTypes,
            List<PostUsersSignInDataServices> services,
            PostUsersSignInDataSubscription subscription,
            List<PostUsersSignInDataAuthenticationSubscription> subscriptions,
            String thumb,
            String title,
            String username,
            String uuid,
            List<PastSubscription> pastSubscriptions,
            List<Trials> trials) {
        this(Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), authToken, Optional.empty(), Optional.empty(), country, email, Optional.empty(), Optional.empty(), friendlyName, entitlements, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), homeSize, id, joinedAt, Optional.empty(), Optional.empty(), mailingListStatus, maxHomeSize, Optional.empty(), profile, Optional.empty(), rememberExpiresAt, Optional.empty(), Optional.empty(), scrobbleTypes, services, subscription, Optional.empty(), subscriptions, thumb, title, Optional.empty(), username, uuid, Optional.empty(), pastSubscriptions, trials);
    }

    /**
     * Unknown
     */
    @JsonIgnore
    public Optional<Boolean> adsConsent() {
        return adsConsent;
    }

    @JsonIgnore
    public Optional<Long> adsConsentReminderAt() {
        return adsConsentReminderAt;
    }

    @JsonIgnore
    public Optional<Long> adsConsentSetAt() {
        return adsConsentSetAt;
    }

    /**
     * Unknown
     */
    @JsonIgnore
    public JsonNullable<Boolean> anonymous() {
        return anonymous;
    }

    /**
     * The account token
     */
    @JsonIgnore
    public String authToken() {
        return authToken;
    }

    /**
     * If the two-factor authentication backup codes have been created
     */
    @JsonIgnore
    public Optional<Boolean> backupCodesCreated() {
        return backupCodesCreated;
    }

    /**
     * If the account has been confirmed
     */
    @JsonIgnore
    public Optional<Boolean> confirmed() {
        return confirmed;
    }

    /**
     * The account country
     */
    @JsonIgnore
    public String country() {
        return country;
    }

    /**
     * The account email address
     */
    @JsonIgnore
    public String email() {
        return email;
    }

    /**
     * If login with email only is enabled
     */
    @JsonIgnore
    public Optional<Boolean> emailOnlyAuth() {
        return emailOnlyAuth;
    }

    /**
     * If experimental features are enabled
     */
    @JsonIgnore
    public Optional<Boolean> experimentalFeatures() {
        return experimentalFeatures;
    }

    /**
     * Your account full name
     */
    @JsonIgnore
    public String friendlyName() {
        return friendlyName;
    }

    /**
     * List of devices your allowed to use with this account
     */
    @JsonIgnore
    public List<String> entitlements() {
        return entitlements;
    }

    /**
     * If the account is a Plex Home guest user
     */
    @JsonIgnore
    public Optional<Boolean> guest() {
        return guest;
    }

    /**
     * If the account has a password
     */
    @JsonIgnore
    public Optional<Boolean> hasPassword() {
        return hasPassword;
    }

    /**
     * If the account is a Plex Home user
     */
    @JsonIgnore
    public Optional<Boolean> home() {
        return home;
    }

    /**
     * If the account is the Plex Home admin
     */
    @JsonIgnore
    public Optional<Boolean> homeAdmin() {
        return homeAdmin;
    }

    /**
     * The number of accounts in the Plex Home
     */
    @JsonIgnore
    public int homeSize() {
        return homeSize;
    }

    /**
     * The Plex account ID
     */
    @JsonIgnore
    public int id() {
        return id;
    }

    /**
     * Unix epoch datetime in seconds
     */
    @JsonIgnore
    public long joinedAt() {
        return joinedAt;
    }

    /**
     * The account locale
     */
    @JsonIgnore
    public Optional<String> locale() {
        return locale;
    }

    /**
     * If you are subscribed to the Plex newsletter
     */
    @JsonIgnore
    public Optional<Boolean> mailingListActive() {
        return mailingListActive;
    }

    /**
     * Your current mailing list status (active or unsubscribed)
     */
    @JsonIgnore
    public PostUsersSignInDataMailingListStatus mailingListStatus() {
        return mailingListStatus;
    }

    /**
     * The maximum number of accounts allowed in the Plex Home
     */
    @JsonIgnore
    public int maxHomeSize() {
        return maxHomeSize;
    }

    /**
     * [Might be removed] The hashed Plex Home PIN 
     * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    @Deprecated
    @JsonIgnore
    public Optional<String> pin() {
        return pin;
    }

    @JsonIgnore
    public PostUsersSignInDataUserProfile profile() {
        return profile;
    }

    /**
     * If the account has a Plex Home PIN enabled
     */
    @JsonIgnore
    public Optional<Boolean> protected_() {
        return protected_;
    }

    /**
     * Unix epoch datetime in seconds
     */
    @JsonIgnore
    public long rememberExpiresAt() {
        return rememberExpiresAt;
    }

    /**
     * If the account is a Plex Home managed user
     */
    @JsonIgnore
    public Optional<Boolean> restricted() {
        return restricted;
    }

    /**
     * [Might be removed] List of account roles. Plexpass membership listed here
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<String>> roles() {
        return (Optional<List<String>>) roles;
    }

    /**
     * Unknown
     */
    @JsonIgnore
    public String scrobbleTypes() {
        return scrobbleTypes;
    }

    @JsonIgnore
    public List<PostUsersSignInDataServices> services() {
        return services;
    }

    /**
     * If the account’s Plex Pass subscription is active
     */
    @JsonIgnore
    public PostUsersSignInDataSubscription subscription() {
        return subscription;
    }

    /**
     * Description of the Plex Pass subscription
     */
    @JsonIgnore
    public Optional<String> subscriptionDescription() {
        return subscriptionDescription;
    }

    @JsonIgnore
    public List<PostUsersSignInDataAuthenticationSubscription> subscriptions() {
        return subscriptions;
    }

    /**
     * URL of the account thumbnail
     */
    @JsonIgnore
    public String thumb() {
        return thumb;
    }

    /**
     * The title of the account (username or friendly name)
     */
    @JsonIgnore
    public String title() {
        return title;
    }

    /**
     * If two-factor authentication is enabled
     */
    @JsonIgnore
    public Optional<Boolean> twoFactorEnabled() {
        return twoFactorEnabled;
    }

    /**
     * The account username
     */
    @JsonIgnore
    public String username() {
        return username;
    }

    /**
     * The account UUID
     */
    @JsonIgnore
    public String uuid() {
        return uuid;
    }

    @JsonIgnore
    public Optional<String> attributionPartner() {
        return attributionPartner;
    }

    @JsonIgnore
    public List<PastSubscription> pastSubscriptions() {
        return pastSubscriptions;
    }

    @JsonIgnore
    public List<Trials> trials() {
        return trials;
    }

    public final static Builder builder() {
        return new Builder();
    }

    /**
     * Unknown
     */
    public PostUsersSignInDataUserPlexAccount withAdsConsent(boolean adsConsent) {
        Utils.checkNotNull(adsConsent, "adsConsent");
        this.adsConsent = Optional.ofNullable(adsConsent);
        return this;
    }

    /**
     * Unknown
     */
    public PostUsersSignInDataUserPlexAccount withAdsConsent(Optional<Boolean> adsConsent) {
        Utils.checkNotNull(adsConsent, "adsConsent");
        this.adsConsent = adsConsent;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(long adsConsentReminderAt) {
        Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
        this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
        Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
        this.adsConsentReminderAt = adsConsentReminderAt;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(long adsConsentSetAt) {
        Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
        this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(Optional<Long> adsConsentSetAt) {
        Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
        this.adsConsentSetAt = adsConsentSetAt;
        return this;
    }

    /**
     * Unknown
     */
    public PostUsersSignInDataUserPlexAccount withAnonymous(boolean anonymous) {
        Utils.checkNotNull(anonymous, "anonymous");
        this.anonymous = JsonNullable.of(anonymous);
        return this;
    }

    /**
     * Unknown
     */
    public PostUsersSignInDataUserPlexAccount withAnonymous(JsonNullable<Boolean> anonymous) {
        Utils.checkNotNull(anonymous, "anonymous");
        this.anonymous = anonymous;
        return this;
    }

    /**
     * The account token
     */
    public PostUsersSignInDataUserPlexAccount withAuthToken(String authToken) {
        Utils.checkNotNull(authToken, "authToken");
        this.authToken = authToken;
        return this;
    }

    /**
     * If the two-factor authentication backup codes have been created
     */
    public PostUsersSignInDataUserPlexAccount withBackupCodesCreated(boolean backupCodesCreated) {
        Utils.checkNotNull(backupCodesCreated, "backupCodesCreated");
        this.backupCodesCreated = Optional.ofNullable(backupCodesCreated);
        return this;
    }

    /**
     * If the two-factor authentication backup codes have been created
     */
    public PostUsersSignInDataUserPlexAccount withBackupCodesCreated(Optional<Boolean> backupCodesCreated) {
        Utils.checkNotNull(backupCodesCreated, "backupCodesCreated");
        this.backupCodesCreated = backupCodesCreated;
        return this;
    }

    /**
     * If the account has been confirmed
     */
    public PostUsersSignInDataUserPlexAccount withConfirmed(boolean confirmed) {
        Utils.checkNotNull(confirmed, "confirmed");
        this.confirmed = Optional.ofNullable(confirmed);
        return this;
    }

    /**
     * If the account has been confirmed
     */
    public PostUsersSignInDataUserPlexAccount withConfirmed(Optional<Boolean> confirmed) {
        Utils.checkNotNull(confirmed, "confirmed");
        this.confirmed = confirmed;
        return this;
    }

    /**
     * The account country
     */
    public PostUsersSignInDataUserPlexAccount withCountry(String country) {
        Utils.checkNotNull(country, "country");
        this.country = country;
        return this;
    }

    /**
     * The account email address
     */
    public PostUsersSignInDataUserPlexAccount withEmail(String email) {
        Utils.checkNotNull(email, "email");
        this.email = email;
        return this;
    }

    /**
     * If login with email only is enabled
     */
    public PostUsersSignInDataUserPlexAccount withEmailOnlyAuth(boolean emailOnlyAuth) {
        Utils.checkNotNull(emailOnlyAuth, "emailOnlyAuth");
        this.emailOnlyAuth = Optional.ofNullable(emailOnlyAuth);
        return this;
    }

    /**
     * If login with email only is enabled
     */
    public PostUsersSignInDataUserPlexAccount withEmailOnlyAuth(Optional<Boolean> emailOnlyAuth) {
        Utils.checkNotNull(emailOnlyAuth, "emailOnlyAuth");
        this.emailOnlyAuth = emailOnlyAuth;
        return this;
    }

    /**
     * If experimental features are enabled
     */
    public PostUsersSignInDataUserPlexAccount withExperimentalFeatures(boolean experimentalFeatures) {
        Utils.checkNotNull(experimentalFeatures, "experimentalFeatures");
        this.experimentalFeatures = Optional.ofNullable(experimentalFeatures);
        return this;
    }

    /**
     * If experimental features are enabled
     */
    public PostUsersSignInDataUserPlexAccount withExperimentalFeatures(Optional<Boolean> experimentalFeatures) {
        Utils.checkNotNull(experimentalFeatures, "experimentalFeatures");
        this.experimentalFeatures = experimentalFeatures;
        return this;
    }

    /**
     * Your account full name
     */
    public PostUsersSignInDataUserPlexAccount withFriendlyName(String friendlyName) {
        Utils.checkNotNull(friendlyName, "friendlyName");
        this.friendlyName = friendlyName;
        return this;
    }

    /**
     * List of devices your allowed to use with this account
     */
    public PostUsersSignInDataUserPlexAccount withEntitlements(List<String> entitlements) {
        Utils.checkNotNull(entitlements, "entitlements");
        this.entitlements = entitlements;
        return this;
    }

    /**
     * If the account is a Plex Home guest user
     */
    public PostUsersSignInDataUserPlexAccount withGuest(boolean guest) {
        Utils.checkNotNull(guest, "guest");
        this.guest = Optional.ofNullable(guest);
        return this;
    }

    /**
     * If the account is a Plex Home guest user
     */
    public PostUsersSignInDataUserPlexAccount withGuest(Optional<Boolean> guest) {
        Utils.checkNotNull(guest, "guest");
        this.guest = guest;
        return this;
    }

    /**
     * If the account has a password
     */
    public PostUsersSignInDataUserPlexAccount withHasPassword(boolean hasPassword) {
        Utils.checkNotNull(hasPassword, "hasPassword");
        this.hasPassword = Optional.ofNullable(hasPassword);
        return this;
    }

    /**
     * If the account has a password
     */
    public PostUsersSignInDataUserPlexAccount withHasPassword(Optional<Boolean> hasPassword) {
        Utils.checkNotNull(hasPassword, "hasPassword");
        this.hasPassword = hasPassword;
        return this;
    }

    /**
     * If the account is a Plex Home user
     */
    public PostUsersSignInDataUserPlexAccount withHome(boolean home) {
        Utils.checkNotNull(home, "home");
        this.home = Optional.ofNullable(home);
        return this;
    }

    /**
     * If the account is a Plex Home user
     */
    public PostUsersSignInDataUserPlexAccount withHome(Optional<Boolean> home) {
        Utils.checkNotNull(home, "home");
        this.home = home;
        return this;
    }

    /**
     * If the account is the Plex Home admin
     */
    public PostUsersSignInDataUserPlexAccount withHomeAdmin(boolean homeAdmin) {
        Utils.checkNotNull(homeAdmin, "homeAdmin");
        this.homeAdmin = Optional.ofNullable(homeAdmin);
        return this;
    }

    /**
     * If the account is the Plex Home admin
     */
    public PostUsersSignInDataUserPlexAccount withHomeAdmin(Optional<Boolean> homeAdmin) {
        Utils.checkNotNull(homeAdmin, "homeAdmin");
        this.homeAdmin = homeAdmin;
        return this;
    }

    /**
     * The number of accounts in the Plex Home
     */
    public PostUsersSignInDataUserPlexAccount withHomeSize(int homeSize) {
        Utils.checkNotNull(homeSize, "homeSize");
        this.homeSize = homeSize;
        return this;
    }

    /**
     * The Plex account ID
     */
    public PostUsersSignInDataUserPlexAccount withId(int id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

    /**
     * Unix epoch datetime in seconds
     */
    public PostUsersSignInDataUserPlexAccount withJoinedAt(long joinedAt) {
        Utils.checkNotNull(joinedAt, "joinedAt");
        this.joinedAt = joinedAt;
        return this;
    }

    /**
     * The account locale
     */
    public PostUsersSignInDataUserPlexAccount withLocale(String locale) {
        Utils.checkNotNull(locale, "locale");
        this.locale = Optional.ofNullable(locale);
        return this;
    }

    /**
     * The account locale
     */
    public PostUsersSignInDataUserPlexAccount withLocale(Optional<String> locale) {
        Utils.checkNotNull(locale, "locale");
        this.locale = locale;
        return this;
    }

    /**
     * If you are subscribed to the Plex newsletter
     */
    public PostUsersSignInDataUserPlexAccount withMailingListActive(boolean mailingListActive) {
        Utils.checkNotNull(mailingListActive, "mailingListActive");
        this.mailingListActive = Optional.ofNullable(mailingListActive);
        return this;
    }

    /**
     * If you are subscribed to the Plex newsletter
     */
    public PostUsersSignInDataUserPlexAccount withMailingListActive(Optional<Boolean> mailingListActive) {
        Utils.checkNotNull(mailingListActive, "mailingListActive");
        this.mailingListActive = mailingListActive;
        return this;
    }

    /**
     * Your current mailing list status (active or unsubscribed)
     */
    public PostUsersSignInDataUserPlexAccount withMailingListStatus(PostUsersSignInDataMailingListStatus mailingListStatus) {
        Utils.checkNotNull(mailingListStatus, "mailingListStatus");
        this.mailingListStatus = mailingListStatus;
        return this;
    }

    /**
     * The maximum number of accounts allowed in the Plex Home
     */
    public PostUsersSignInDataUserPlexAccount withMaxHomeSize(int maxHomeSize) {
        Utils.checkNotNull(maxHomeSize, "maxHomeSize");
        this.maxHomeSize = maxHomeSize;
        return this;
    }

    /**
     * [Might be removed] The hashed Plex Home PIN 
     * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    @Deprecated
    public PostUsersSignInDataUserPlexAccount withPin(String pin) {
        Utils.checkNotNull(pin, "pin");
        this.pin = Optional.ofNullable(pin);
        return this;
    }

    /**
     * [Might be removed] The hashed Plex Home PIN 
     * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    @Deprecated
    public PostUsersSignInDataUserPlexAccount withPin(Optional<String> pin) {
        Utils.checkNotNull(pin, "pin");
        this.pin = pin;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withProfile(PostUsersSignInDataUserProfile profile) {
        Utils.checkNotNull(profile, "profile");
        this.profile = profile;
        return this;
    }

    /**
     * If the account has a Plex Home PIN enabled
     */
    public PostUsersSignInDataUserPlexAccount withProtected(boolean protected_) {
        Utils.checkNotNull(protected_, "protected_");
        this.protected_ = Optional.ofNullable(protected_);
        return this;
    }

    /**
     * If the account has a Plex Home PIN enabled
     */
    public PostUsersSignInDataUserPlexAccount withProtected(Optional<Boolean> protected_) {
        Utils.checkNotNull(protected_, "protected_");
        this.protected_ = protected_;
        return this;
    }

    /**
     * Unix epoch datetime in seconds
     */
    public PostUsersSignInDataUserPlexAccount withRememberExpiresAt(long rememberExpiresAt) {
        Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt");
        this.rememberExpiresAt = rememberExpiresAt;
        return this;
    }

    /**
     * If the account is a Plex Home managed user
     */
    public PostUsersSignInDataUserPlexAccount withRestricted(boolean restricted) {
        Utils.checkNotNull(restricted, "restricted");
        this.restricted = Optional.ofNullable(restricted);
        return this;
    }

    /**
     * If the account is a Plex Home managed user
     */
    public PostUsersSignInDataUserPlexAccount withRestricted(Optional<Boolean> restricted) {
        Utils.checkNotNull(restricted, "restricted");
        this.restricted = restricted;
        return this;
    }

    /**
     * [Might be removed] List of account roles. Plexpass membership listed here
     */
    public PostUsersSignInDataUserPlexAccount withRoles(List<String> roles) {
        Utils.checkNotNull(roles, "roles");
        this.roles = Optional.ofNullable(roles);
        return this;
    }

    /**
     * [Might be removed] List of account roles. Plexpass membership listed here
     */
    public PostUsersSignInDataUserPlexAccount withRoles(Optional<? extends List<String>> roles) {
        Utils.checkNotNull(roles, "roles");
        this.roles = roles;
        return this;
    }

    /**
     * Unknown
     */
    public PostUsersSignInDataUserPlexAccount withScrobbleTypes(String scrobbleTypes) {
        Utils.checkNotNull(scrobbleTypes, "scrobbleTypes");
        this.scrobbleTypes = scrobbleTypes;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withServices(List<PostUsersSignInDataServices> services) {
        Utils.checkNotNull(services, "services");
        this.services = services;
        return this;
    }

    /**
     * If the account’s Plex Pass subscription is active
     */
    public PostUsersSignInDataUserPlexAccount withSubscription(PostUsersSignInDataSubscription subscription) {
        Utils.checkNotNull(subscription, "subscription");
        this.subscription = subscription;
        return this;
    }

    /**
     * Description of the Plex Pass subscription
     */
    public PostUsersSignInDataUserPlexAccount withSubscriptionDescription(String subscriptionDescription) {
        Utils.checkNotNull(subscriptionDescription, "subscriptionDescription");
        this.subscriptionDescription = Optional.ofNullable(subscriptionDescription);
        return this;
    }

    /**
     * Description of the Plex Pass subscription
     */
    public PostUsersSignInDataUserPlexAccount withSubscriptionDescription(Optional<String> subscriptionDescription) {
        Utils.checkNotNull(subscriptionDescription, "subscriptionDescription");
        this.subscriptionDescription = subscriptionDescription;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withSubscriptions(List<PostUsersSignInDataAuthenticationSubscription> subscriptions) {
        Utils.checkNotNull(subscriptions, "subscriptions");
        this.subscriptions = subscriptions;
        return this;
    }

    /**
     * URL of the account thumbnail
     */
    public PostUsersSignInDataUserPlexAccount withThumb(String thumb) {
        Utils.checkNotNull(thumb, "thumb");
        this.thumb = thumb;
        return this;
    }

    /**
     * The title of the account (username or friendly name)
     */
    public PostUsersSignInDataUserPlexAccount withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }

    /**
     * If two-factor authentication is enabled
     */
    public PostUsersSignInDataUserPlexAccount withTwoFactorEnabled(boolean twoFactorEnabled) {
        Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled");
        this.twoFactorEnabled = Optional.ofNullable(twoFactorEnabled);
        return this;
    }

    /**
     * If two-factor authentication is enabled
     */
    public PostUsersSignInDataUserPlexAccount withTwoFactorEnabled(Optional<Boolean> twoFactorEnabled) {
        Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled");
        this.twoFactorEnabled = twoFactorEnabled;
        return this;
    }

    /**
     * The account username
     */
    public PostUsersSignInDataUserPlexAccount withUsername(String username) {
        Utils.checkNotNull(username, "username");
        this.username = username;
        return this;
    }

    /**
     * The account UUID
     */
    public PostUsersSignInDataUserPlexAccount withUuid(String uuid) {
        Utils.checkNotNull(uuid, "uuid");
        this.uuid = uuid;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAttributionPartner(String attributionPartner) {
        Utils.checkNotNull(attributionPartner, "attributionPartner");
        this.attributionPartner = Optional.ofNullable(attributionPartner);
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withAttributionPartner(Optional<String> attributionPartner) {
        Utils.checkNotNull(attributionPartner, "attributionPartner");
        this.attributionPartner = attributionPartner;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withPastSubscriptions(List<PastSubscription> pastSubscriptions) {
        Utils.checkNotNull(pastSubscriptions, "pastSubscriptions");
        this.pastSubscriptions = pastSubscriptions;
        return this;
    }

    public PostUsersSignInDataUserPlexAccount withTrials(List<Trials> trials) {
        Utils.checkNotNull(trials, "trials");
        this.trials = trials;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PostUsersSignInDataUserPlexAccount other = (PostUsersSignInDataUserPlexAccount) o;
        return 
            Objects.deepEquals(this.adsConsent, other.adsConsent) &&
            Objects.deepEquals(this.adsConsentReminderAt, other.adsConsentReminderAt) &&
            Objects.deepEquals(this.adsConsentSetAt, other.adsConsentSetAt) &&
            Objects.deepEquals(this.anonymous, other.anonymous) &&
            Objects.deepEquals(this.authToken, other.authToken) &&
            Objects.deepEquals(this.backupCodesCreated, other.backupCodesCreated) &&
            Objects.deepEquals(this.confirmed, other.confirmed) &&
            Objects.deepEquals(this.country, other.country) &&
            Objects.deepEquals(this.email, other.email) &&
            Objects.deepEquals(this.emailOnlyAuth, other.emailOnlyAuth) &&
            Objects.deepEquals(this.experimentalFeatures, other.experimentalFeatures) &&
            Objects.deepEquals(this.friendlyName, other.friendlyName) &&
            Objects.deepEquals(this.entitlements, other.entitlements) &&
            Objects.deepEquals(this.guest, other.guest) &&
            Objects.deepEquals(this.hasPassword, other.hasPassword) &&
            Objects.deepEquals(this.home, other.home) &&
            Objects.deepEquals(this.homeAdmin, other.homeAdmin) &&
            Objects.deepEquals(this.homeSize, other.homeSize) &&
            Objects.deepEquals(this.id, other.id) &&
            Objects.deepEquals(this.joinedAt, other.joinedAt) &&
            Objects.deepEquals(this.locale, other.locale) &&
            Objects.deepEquals(this.mailingListActive, other.mailingListActive) &&
            Objects.deepEquals(this.mailingListStatus, other.mailingListStatus) &&
            Objects.deepEquals(this.maxHomeSize, other.maxHomeSize) &&
            Objects.deepEquals(this.pin, other.pin) &&
            Objects.deepEquals(this.profile, other.profile) &&
            Objects.deepEquals(this.protected_, other.protected_) &&
            Objects.deepEquals(this.rememberExpiresAt, other.rememberExpiresAt) &&
            Objects.deepEquals(this.restricted, other.restricted) &&
            Objects.deepEquals(this.roles, other.roles) &&
            Objects.deepEquals(this.scrobbleTypes, other.scrobbleTypes) &&
            Objects.deepEquals(this.services, other.services) &&
            Objects.deepEquals(this.subscription, other.subscription) &&
            Objects.deepEquals(this.subscriptionDescription, other.subscriptionDescription) &&
            Objects.deepEquals(this.subscriptions, other.subscriptions) &&
            Objects.deepEquals(this.thumb, other.thumb) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.twoFactorEnabled, other.twoFactorEnabled) &&
            Objects.deepEquals(this.username, other.username) &&
            Objects.deepEquals(this.uuid, other.uuid) &&
            Objects.deepEquals(this.attributionPartner, other.attributionPartner) &&
            Objects.deepEquals(this.pastSubscriptions, other.pastSubscriptions) &&
            Objects.deepEquals(this.trials, other.trials);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            adsConsent,
            adsConsentReminderAt,
            adsConsentSetAt,
            anonymous,
            authToken,
            backupCodesCreated,
            confirmed,
            country,
            email,
            emailOnlyAuth,
            experimentalFeatures,
            friendlyName,
            entitlements,
            guest,
            hasPassword,
            home,
            homeAdmin,
            homeSize,
            id,
            joinedAt,
            locale,
            mailingListActive,
            mailingListStatus,
            maxHomeSize,
            pin,
            profile,
            protected_,
            rememberExpiresAt,
            restricted,
            roles,
            scrobbleTypes,
            services,
            subscription,
            subscriptionDescription,
            subscriptions,
            thumb,
            title,
            twoFactorEnabled,
            username,
            uuid,
            attributionPartner,
            pastSubscriptions,
            trials);
    }
    
    @Override
    public String toString() {
        return Utils.toString(PostUsersSignInDataUserPlexAccount.class,
                "adsConsent", adsConsent,
                "adsConsentReminderAt", adsConsentReminderAt,
                "adsConsentSetAt", adsConsentSetAt,
                "anonymous", anonymous,
                "authToken", authToken,
                "backupCodesCreated", backupCodesCreated,
                "confirmed", confirmed,
                "country", country,
                "email", email,
                "emailOnlyAuth", emailOnlyAuth,
                "experimentalFeatures", experimentalFeatures,
                "friendlyName", friendlyName,
                "entitlements", entitlements,
                "guest", guest,
                "hasPassword", hasPassword,
                "home", home,
                "homeAdmin", homeAdmin,
                "homeSize", homeSize,
                "id", id,
                "joinedAt", joinedAt,
                "locale", locale,
                "mailingListActive", mailingListActive,
                "mailingListStatus", mailingListStatus,
                "maxHomeSize", maxHomeSize,
                "pin", pin,
                "profile", profile,
                "protected_", protected_,
                "rememberExpiresAt", rememberExpiresAt,
                "restricted", restricted,
                "roles", roles,
                "scrobbleTypes", scrobbleTypes,
                "services", services,
                "subscription", subscription,
                "subscriptionDescription", subscriptionDescription,
                "subscriptions", subscriptions,
                "thumb", thumb,
                "title", title,
                "twoFactorEnabled", twoFactorEnabled,
                "username", username,
                "uuid", uuid,
                "attributionPartner", attributionPartner,
                "pastSubscriptions", pastSubscriptions,
                "trials", trials);
    }
    
    public final static class Builder {
 
        private Optional<Boolean> adsConsent = Optional.empty();
 
        private Optional<Long> adsConsentReminderAt = Optional.empty();
 
        private Optional<Long> adsConsentSetAt = Optional.empty();
 
        private JsonNullable<Boolean> anonymous;
 
        private String authToken;
 
        private Optional<Boolean> backupCodesCreated;
 
        private Optional<Boolean> confirmed;
 
        private String country;
 
        private String email;
 
        private Optional<Boolean> emailOnlyAuth;
 
        private Optional<Boolean> experimentalFeatures;
 
        private String friendlyName;
 
        private List<String> entitlements;
 
        private Optional<Boolean> guest;
 
        private Optional<Boolean> hasPassword;
 
        private Optional<Boolean> home;
 
        private Optional<Boolean> homeAdmin;
 
        private Integer homeSize;
 
        private Integer id;
 
        private Long joinedAt;
 
        private Optional<String> locale = Optional.empty();
 
        private Optional<Boolean> mailingListActive;
 
        private PostUsersSignInDataMailingListStatus mailingListStatus;
 
        private Integer maxHomeSize;
 
        @Deprecated
        private Optional<String> pin = Optional.empty();
 
        private PostUsersSignInDataUserProfile profile;
 
        private Optional<Boolean> protected_;
 
        private Long rememberExpiresAt;
 
        private Optional<Boolean> restricted;
 
        private Optional<? extends List<String>> roles = Optional.empty();
 
        private String scrobbleTypes;
 
        private List<PostUsersSignInDataServices> services;
 
        private PostUsersSignInDataSubscription subscription;
 
        private Optional<String> subscriptionDescription = Optional.empty();
 
        private List<PostUsersSignInDataAuthenticationSubscription> subscriptions;
 
        private String thumb;
 
        private String title;
 
        private Optional<Boolean> twoFactorEnabled;
 
        private String username;
 
        private String uuid;
 
        private Optional<String> attributionPartner = Optional.empty();
 
        private List<PastSubscription> pastSubscriptions;
 
        private List<Trials> trials;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * Unknown
         */
        public Builder adsConsent(boolean adsConsent) {
            Utils.checkNotNull(adsConsent, "adsConsent");
            this.adsConsent = Optional.ofNullable(adsConsent);
            return this;
        }

        /**
         * Unknown
         */
        public Builder adsConsent(Optional<Boolean> adsConsent) {
            Utils.checkNotNull(adsConsent, "adsConsent");
            this.adsConsent = adsConsent;
            return this;
        }

        public Builder adsConsentReminderAt(long adsConsentReminderAt) {
            Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
            this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt);
            return this;
        }

        public Builder adsConsentReminderAt(Optional<Long> adsConsentReminderAt) {
            Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt");
            this.adsConsentReminderAt = adsConsentReminderAt;
            return this;
        }

        public Builder adsConsentSetAt(long adsConsentSetAt) {
            Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
            this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt);
            return this;
        }

        public Builder adsConsentSetAt(Optional<Long> adsConsentSetAt) {
            Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt");
            this.adsConsentSetAt = adsConsentSetAt;
            return this;
        }

        /**
         * Unknown
         */
        public Builder anonymous(boolean anonymous) {
            Utils.checkNotNull(anonymous, "anonymous");
            this.anonymous = JsonNullable.of(anonymous);
            return this;
        }

        /**
         * Unknown
         */
        public Builder anonymous(JsonNullable<Boolean> anonymous) {
            Utils.checkNotNull(anonymous, "anonymous");
            this.anonymous = anonymous;
            return this;
        }

        /**
         * The account token
         */
        public Builder authToken(String authToken) {
            Utils.checkNotNull(authToken, "authToken");
            this.authToken = authToken;
            return this;
        }

        /**
         * If the two-factor authentication backup codes have been created
         */
        public Builder backupCodesCreated(boolean backupCodesCreated) {
            Utils.checkNotNull(backupCodesCreated, "backupCodesCreated");
            this.backupCodesCreated = Optional.ofNullable(backupCodesCreated);
            return this;
        }

        /**
         * If the two-factor authentication backup codes have been created
         */
        public Builder backupCodesCreated(Optional<Boolean> backupCodesCreated) {
            Utils.checkNotNull(backupCodesCreated, "backupCodesCreated");
            this.backupCodesCreated = backupCodesCreated;
            return this;
        }

        /**
         * If the account has been confirmed
         */
        public Builder confirmed(boolean confirmed) {
            Utils.checkNotNull(confirmed, "confirmed");
            this.confirmed = Optional.ofNullable(confirmed);
            return this;
        }

        /**
         * If the account has been confirmed
         */
        public Builder confirmed(Optional<Boolean> confirmed) {
            Utils.checkNotNull(confirmed, "confirmed");
            this.confirmed = confirmed;
            return this;
        }

        /**
         * The account country
         */
        public Builder country(String country) {
            Utils.checkNotNull(country, "country");
            this.country = country;
            return this;
        }

        /**
         * The account email address
         */
        public Builder email(String email) {
            Utils.checkNotNull(email, "email");
            this.email = email;
            return this;
        }

        /**
         * If login with email only is enabled
         */
        public Builder emailOnlyAuth(boolean emailOnlyAuth) {
            Utils.checkNotNull(emailOnlyAuth, "emailOnlyAuth");
            this.emailOnlyAuth = Optional.ofNullable(emailOnlyAuth);
            return this;
        }

        /**
         * If login with email only is enabled
         */
        public Builder emailOnlyAuth(Optional<Boolean> emailOnlyAuth) {
            Utils.checkNotNull(emailOnlyAuth, "emailOnlyAuth");
            this.emailOnlyAuth = emailOnlyAuth;
            return this;
        }

        /**
         * If experimental features are enabled
         */
        public Builder experimentalFeatures(boolean experimentalFeatures) {
            Utils.checkNotNull(experimentalFeatures, "experimentalFeatures");
            this.experimentalFeatures = Optional.ofNullable(experimentalFeatures);
            return this;
        }

        /**
         * If experimental features are enabled
         */
        public Builder experimentalFeatures(Optional<Boolean> experimentalFeatures) {
            Utils.checkNotNull(experimentalFeatures, "experimentalFeatures");
            this.experimentalFeatures = experimentalFeatures;
            return this;
        }

        /**
         * Your account full name
         */
        public Builder friendlyName(String friendlyName) {
            Utils.checkNotNull(friendlyName, "friendlyName");
            this.friendlyName = friendlyName;
            return this;
        }

        /**
         * List of devices your allowed to use with this account
         */
        public Builder entitlements(List<String> entitlements) {
            Utils.checkNotNull(entitlements, "entitlements");
            this.entitlements = entitlements;
            return this;
        }

        /**
         * If the account is a Plex Home guest user
         */
        public Builder guest(boolean guest) {
            Utils.checkNotNull(guest, "guest");
            this.guest = Optional.ofNullable(guest);
            return this;
        }

        /**
         * If the account is a Plex Home guest user
         */
        public Builder guest(Optional<Boolean> guest) {
            Utils.checkNotNull(guest, "guest");
            this.guest = guest;
            return this;
        }

        /**
         * If the account has a password
         */
        public Builder hasPassword(boolean hasPassword) {
            Utils.checkNotNull(hasPassword, "hasPassword");
            this.hasPassword = Optional.ofNullable(hasPassword);
            return this;
        }

        /**
         * If the account has a password
         */
        public Builder hasPassword(Optional<Boolean> hasPassword) {
            Utils.checkNotNull(hasPassword, "hasPassword");
            this.hasPassword = hasPassword;
            return this;
        }

        /**
         * If the account is a Plex Home user
         */
        public Builder home(boolean home) {
            Utils.checkNotNull(home, "home");
            this.home = Optional.ofNullable(home);
            return this;
        }

        /**
         * If the account is a Plex Home user
         */
        public Builder home(Optional<Boolean> home) {
            Utils.checkNotNull(home, "home");
            this.home = home;
            return this;
        }

        /**
         * If the account is the Plex Home admin
         */
        public Builder homeAdmin(boolean homeAdmin) {
            Utils.checkNotNull(homeAdmin, "homeAdmin");
            this.homeAdmin = Optional.ofNullable(homeAdmin);
            return this;
        }

        /**
         * If the account is the Plex Home admin
         */
        public Builder homeAdmin(Optional<Boolean> homeAdmin) {
            Utils.checkNotNull(homeAdmin, "homeAdmin");
            this.homeAdmin = homeAdmin;
            return this;
        }

        /**
         * The number of accounts in the Plex Home
         */
        public Builder homeSize(int homeSize) {
            Utils.checkNotNull(homeSize, "homeSize");
            this.homeSize = homeSize;
            return this;
        }

        /**
         * The Plex account ID
         */
        public Builder id(int id) {
            Utils.checkNotNull(id, "id");
            this.id = id;
            return this;
        }

        /**
         * Unix epoch datetime in seconds
         */
        public Builder joinedAt(long joinedAt) {
            Utils.checkNotNull(joinedAt, "joinedAt");
            this.joinedAt = joinedAt;
            return this;
        }

        /**
         * The account locale
         */
        public Builder locale(String locale) {
            Utils.checkNotNull(locale, "locale");
            this.locale = Optional.ofNullable(locale);
            return this;
        }

        /**
         * The account locale
         */
        public Builder locale(Optional<String> locale) {
            Utils.checkNotNull(locale, "locale");
            this.locale = locale;
            return this;
        }

        /**
         * If you are subscribed to the Plex newsletter
         */
        public Builder mailingListActive(boolean mailingListActive) {
            Utils.checkNotNull(mailingListActive, "mailingListActive");
            this.mailingListActive = Optional.ofNullable(mailingListActive);
            return this;
        }

        /**
         * If you are subscribed to the Plex newsletter
         */
        public Builder mailingListActive(Optional<Boolean> mailingListActive) {
            Utils.checkNotNull(mailingListActive, "mailingListActive");
            this.mailingListActive = mailingListActive;
            return this;
        }

        /**
         * Your current mailing list status (active or unsubscribed)
         */
        public Builder mailingListStatus(PostUsersSignInDataMailingListStatus mailingListStatus) {
            Utils.checkNotNull(mailingListStatus, "mailingListStatus");
            this.mailingListStatus = mailingListStatus;
            return this;
        }

        /**
         * The maximum number of accounts allowed in the Plex Home
         */
        public Builder maxHomeSize(int maxHomeSize) {
            Utils.checkNotNull(maxHomeSize, "maxHomeSize");
            this.maxHomeSize = maxHomeSize;
            return this;
        }

        /**
         * [Might be removed] The hashed Plex Home PIN 
         * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
         */
        @Deprecated
        public Builder pin(String pin) {
            Utils.checkNotNull(pin, "pin");
            this.pin = Optional.ofNullable(pin);
            return this;
        }

        /**
         * [Might be removed] The hashed Plex Home PIN 
         * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
         */
        @Deprecated
        public Builder pin(Optional<String> pin) {
            Utils.checkNotNull(pin, "pin");
            this.pin = pin;
            return this;
        }

        public Builder profile(PostUsersSignInDataUserProfile profile) {
            Utils.checkNotNull(profile, "profile");
            this.profile = profile;
            return this;
        }

        /**
         * If the account has a Plex Home PIN enabled
         */
        public Builder protected_(boolean protected_) {
            Utils.checkNotNull(protected_, "protected_");
            this.protected_ = Optional.ofNullable(protected_);
            return this;
        }

        /**
         * If the account has a Plex Home PIN enabled
         */
        public Builder protected_(Optional<Boolean> protected_) {
            Utils.checkNotNull(protected_, "protected_");
            this.protected_ = protected_;
            return this;
        }

        /**
         * Unix epoch datetime in seconds
         */
        public Builder rememberExpiresAt(long rememberExpiresAt) {
            Utils.checkNotNull(rememberExpiresAt, "rememberExpiresAt");
            this.rememberExpiresAt = rememberExpiresAt;
            return this;
        }

        /**
         * If the account is a Plex Home managed user
         */
        public Builder restricted(boolean restricted) {
            Utils.checkNotNull(restricted, "restricted");
            this.restricted = Optional.ofNullable(restricted);
            return this;
        }

        /**
         * If the account is a Plex Home managed user
         */
        public Builder restricted(Optional<Boolean> restricted) {
            Utils.checkNotNull(restricted, "restricted");
            this.restricted = restricted;
            return this;
        }

        /**
         * [Might be removed] List of account roles. Plexpass membership listed here
         */
        public Builder roles(List<String> roles) {
            Utils.checkNotNull(roles, "roles");
            this.roles = Optional.ofNullable(roles);
            return this;
        }

        /**
         * [Might be removed] List of account roles. Plexpass membership listed here
         */
        public Builder roles(Optional<? extends List<String>> roles) {
            Utils.checkNotNull(roles, "roles");
            this.roles = roles;
            return this;
        }

        /**
         * Unknown
         */
        public Builder scrobbleTypes(String scrobbleTypes) {
            Utils.checkNotNull(scrobbleTypes, "scrobbleTypes");
            this.scrobbleTypes = scrobbleTypes;
            return this;
        }

        public Builder services(List<PostUsersSignInDataServices> services) {
            Utils.checkNotNull(services, "services");
            this.services = services;
            return this;
        }

        /**
         * If the account’s Plex Pass subscription is active
         */
        public Builder subscription(PostUsersSignInDataSubscription subscription) {
            Utils.checkNotNull(subscription, "subscription");
            this.subscription = subscription;
            return this;
        }

        /**
         * Description of the Plex Pass subscription
         */
        public Builder subscriptionDescription(String subscriptionDescription) {
            Utils.checkNotNull(subscriptionDescription, "subscriptionDescription");
            this.subscriptionDescription = Optional.ofNullable(subscriptionDescription);
            return this;
        }

        /**
         * Description of the Plex Pass subscription
         */
        public Builder subscriptionDescription(Optional<String> subscriptionDescription) {
            Utils.checkNotNull(subscriptionDescription, "subscriptionDescription");
            this.subscriptionDescription = subscriptionDescription;
            return this;
        }

        public Builder subscriptions(List<PostUsersSignInDataAuthenticationSubscription> subscriptions) {
            Utils.checkNotNull(subscriptions, "subscriptions");
            this.subscriptions = subscriptions;
            return this;
        }

        /**
         * URL of the account thumbnail
         */
        public Builder thumb(String thumb) {
            Utils.checkNotNull(thumb, "thumb");
            this.thumb = thumb;
            return this;
        }

        /**
         * The title of the account (username or friendly name)
         */
        public Builder title(String title) {
            Utils.checkNotNull(title, "title");
            this.title = title;
            return this;
        }

        /**
         * If two-factor authentication is enabled
         */
        public Builder twoFactorEnabled(boolean twoFactorEnabled) {
            Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled");
            this.twoFactorEnabled = Optional.ofNullable(twoFactorEnabled);
            return this;
        }

        /**
         * If two-factor authentication is enabled
         */
        public Builder twoFactorEnabled(Optional<Boolean> twoFactorEnabled) {
            Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled");
            this.twoFactorEnabled = twoFactorEnabled;
            return this;
        }

        /**
         * The account username
         */
        public Builder username(String username) {
            Utils.checkNotNull(username, "username");
            this.username = username;
            return this;
        }

        /**
         * The account UUID
         */
        public Builder uuid(String uuid) {
            Utils.checkNotNull(uuid, "uuid");
            this.uuid = uuid;
            return this;
        }

        public Builder attributionPartner(String attributionPartner) {
            Utils.checkNotNull(attributionPartner, "attributionPartner");
            this.attributionPartner = Optional.ofNullable(attributionPartner);
            return this;
        }

        public Builder attributionPartner(Optional<String> attributionPartner) {
            Utils.checkNotNull(attributionPartner, "attributionPartner");
            this.attributionPartner = attributionPartner;
            return this;
        }

        public Builder pastSubscriptions(List<PastSubscription> pastSubscriptions) {
            Utils.checkNotNull(pastSubscriptions, "pastSubscriptions");
            this.pastSubscriptions = pastSubscriptions;
            return this;
        }

        public Builder trials(List<Trials> trials) {
            Utils.checkNotNull(trials, "trials");
            this.trials = trials;
            return this;
        }
        
        public PostUsersSignInDataUserPlexAccount build() {
            if (anonymous == null) {
                anonymous = _SINGLETON_VALUE_Anonymous.value();
            }
            if (backupCodesCreated == null) {
                backupCodesCreated = _SINGLETON_VALUE_BackupCodesCreated.value();
            }
            if (confirmed == null) {
                confirmed = _SINGLETON_VALUE_Confirmed.value();
            }
            if (emailOnlyAuth == null) {
                emailOnlyAuth = _SINGLETON_VALUE_EmailOnlyAuth.value();
            }
            if (experimentalFeatures == null) {
                experimentalFeatures = _SINGLETON_VALUE_ExperimentalFeatures.value();
            }
            if (guest == null) {
                guest = _SINGLETON_VALUE_Guest.value();
            }
            if (hasPassword == null) {
                hasPassword = _SINGLETON_VALUE_HasPassword.value();
            }
            if (home == null) {
                home = _SINGLETON_VALUE_Home.value();
            }
            if (homeAdmin == null) {
                homeAdmin = _SINGLETON_VALUE_HomeAdmin.value();
            }
            if (mailingListActive == null) {
                mailingListActive = _SINGLETON_VALUE_MailingListActive.value();
            }
            if (protected_ == null) {
                protected_ = _SINGLETON_VALUE_Protected.value();
            }
            if (restricted == null) {
                restricted = _SINGLETON_VALUE_Restricted.value();
            }
            if (twoFactorEnabled == null) {
                twoFactorEnabled = _SINGLETON_VALUE_TwoFactorEnabled.value();
            }            return new PostUsersSignInDataUserPlexAccount(
                adsConsent,
                adsConsentReminderAt,
                adsConsentSetAt,
                anonymous,
                authToken,
                backupCodesCreated,
                confirmed,
                country,
                email,
                emailOnlyAuth,
                experimentalFeatures,
                friendlyName,
                entitlements,
                guest,
                hasPassword,
                home,
                homeAdmin,
                homeSize,
                id,
                joinedAt,
                locale,
                mailingListActive,
                mailingListStatus,
                maxHomeSize,
                pin,
                profile,
                protected_,
                rememberExpiresAt,
                restricted,
                roles,
                scrobbleTypes,
                services,
                subscription,
                subscriptionDescription,
                subscriptions,
                thumb,
                title,
                twoFactorEnabled,
                username,
                uuid,
                attributionPartner,
                pastSubscriptions,
                trials);
        }

        private static final LazySingletonValue<JsonNullable<Boolean>> _SINGLETON_VALUE_Anonymous =
                new LazySingletonValue<>(
                        "anonymous",
                        "false",
                        new TypeReference<JsonNullable<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_BackupCodesCreated =
                new LazySingletonValue<>(
                        "backupCodesCreated",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Confirmed =
                new LazySingletonValue<>(
                        "confirmed",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_EmailOnlyAuth =
                new LazySingletonValue<>(
                        "emailOnlyAuth",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_ExperimentalFeatures =
                new LazySingletonValue<>(
                        "experimentalFeatures",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Guest =
                new LazySingletonValue<>(
                        "guest",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_HasPassword =
                new LazySingletonValue<>(
                        "hasPassword",
                        "true",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Home =
                new LazySingletonValue<>(
                        "home",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_HomeAdmin =
                new LazySingletonValue<>(
                        "homeAdmin",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_MailingListActive =
                new LazySingletonValue<>(
                        "mailingListActive",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Protected =
                new LazySingletonValue<>(
                        "protected",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_Restricted =
                new LazySingletonValue<>(
                        "restricted",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});

        private static final LazySingletonValue<Optional<Boolean>> _SINGLETON_VALUE_TwoFactorEnabled =
                new LazySingletonValue<>(
                        "twoFactorEnabled",
                        "false",
                        new TypeReference<Optional<Boolean>>() {});
    }
}

