All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arm.mbed.cloud.sdk.accounts.model.Account Maven / Gradle / Ivy

Go to download

The Pelion Cloud SDK (formerly known as Mbed Cloud SDK) provides a simplified interface to the Pelion Cloud APIs by exposing functionality using conventions and paradigms familiar to Java developers.

There is a newer version: 2.5.0
Show newest version
// This file was generated by the Pelion SDK foundation code generator.
// This is an autogenerated class. Do not modify its content as modifications will be lost at next code generation.
package com.arm.mbed.cloud.sdk.accounts.model;

import com.arm.mbed.cloud.sdk.annotations.DefaultValue;
import com.arm.mbed.cloud.sdk.annotations.Internal;
import com.arm.mbed.cloud.sdk.annotations.Preamble;
import com.arm.mbed.cloud.sdk.annotations.Required;
import com.arm.mbed.cloud.sdk.common.SdkModel;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * Model for an account.
 */
@Preamble(description = "Model for an account.")
@SuppressWarnings({ "PMD.CyclomaticComplexity", "PMD.AvoidDuplicateLiterals" })
public class Account implements SdkModel {
    /**
     * Serialisation Id.
     */
    private static final long serialVersionUID = 6950361011331521L;

    /**
     * Postal address line 1.
     */
    private String addressLine1;

    /**
     * Postal address line 2.
     */
    private String addressLine2;

    /**
     * The email address of the admin user created for this account. Present only in the response for account creation.
     */
    private String adminEmail;

    /**
     * The full name of the admin user created for this account. Present only in the response for account creation.
     */
    private String adminFullName;

    /**
     * The ID of the admin user created for this account.
     */
    private final String adminId;

    /**
     * The admin API key created for this account. Present only in the response for account creation.
     */
    private final String adminKey;

    /**
     * The username of the admin user created for this account. Present only in the response for account creation.
     */
    private String adminName;

    /**
     * The password of the admin user created for this account. Present only in the response for account creation.
     */
    private String adminPassword;

    /**
     * An array of aliases.
     */
    private List aliases;

    /**
     * The city part of the postal address.
     */
    private String city;

    /**
     * The name of the company.
     */
    private String company;

    /**
     * The name of the contact person for this account.
     */
    private String contact;

    /**
     * Contract number of the customer.
     */
    private String contractNumber;

    /**
     * The country part of the postal address.
     */
    private String country;

    /**
     * Creation UTC time RFC3339.
     */
    private final Date createdAt;

    /**
     * Account's custom properties as key-value pairs.
     */
    private Map customFields;

    /**
     * Customer number of the customer.
     */
    private String customerNumber;

    /**
     * The display name for the account.
     */
    private String displayName;

    /**
     * The company email address for this account.
     */
    private String email;

    /**
     * Account end market.
     */
    @Required
    private String endMarket;

    /**
     * Expiration time of the account, as UTC time RFC3339.
     */
    private final Date expiration;

    /**
     * Indicates how many days (1-180) before account expiration a notification email is sent.
     */
    @DefaultValue("1")
    private int expirationWarningThreshold;

    /**
     * Account ID.
     */
    private String id;

    /**
     * The reference token expiration time, in minutes, for this account.
     */
    @DefaultValue("1")
    private int idleTimeout;

    /**
     * List of limits as key-value pairs if requested.
     */
    private final Map limits;

    /**
     * The enforcement status of multi-factor authentication, either `enforced` or `optional`.
     */
    private AccountMfaStatus mfaStatus;

    /**
     * A list of notification email addresses.
     */
    private List notificationEmails;

    /**
     * Represents parent account contact details in responses.
     */
    private final ParentAccount parentAccount;

    /**
     * The ID of the parent account, if any.
     */
    private final String parentId;

    /**
     * The password policy for this account.
     */
    private PasswordPolicy passwordPolicy;

    /**
     * Indicates for how many minutes a password recovery email is valid.
     */
    @DefaultValue("1")
    private int passwordRecoveryExpiration;

    /**
     * The phone number of a company representative.
     */
    private String phoneNumber;

    /**
     * List of policies if requested.
     */
    private final List policies;

    /**
     * The postal code part of the postal address.
     */
    private String postalCode;

    /**
     * A note with the reason for account status update.
     */
    private final String reason;

    /**
     * A reference note for updating the status of the account.
     */
    private final String referenceNote;

    /**
     * Email address of the sales contact.
     */
    private String salesContact;

    /**
     * The state part of the postal address.
     */
    private String state;

    /**
     * The status of the account.
     */
    private final AccountStatus status;

    /**
     * Account template ID.
     */
    private final String templateId;

    /**
     * The tier level of the account; `0`: free tier, `1`: commercial account, `2`: partner tier. Other values are
     * reserved for the future.
     */
    private final String tier;

    /**
     * Last update UTC time RFC3339.
     */
    private final Date updatedAt;

    /**
     * Time when upgraded to commercial account in UTC format RFC3339.
     */
    private final Date upgradedAt;

    /**
     * Internal constructor.
     *
     * 

* Constructor based on all fields. *

* Note: Should not be used. Use {@link #Account()} instead. * * @param addressLine1 * Postal address line 1. * @param addressLine2 * Postal address line 2. * @param adminEmail * The email address of the admin user created for this account. Present only in the response for account * creation. * @param adminFullName * The full name of the admin user created for this account. Present only in the response for account * creation. * @param adminId * The ID of the admin user created for this account. * @param adminKey * The admin API key created for this account. Present only in the response for account creation. * @param adminName * The username of the admin user created for this account. Present only in the response for account * creation. * @param adminPassword * The password of the admin user created for this account. Present only in the response for account * creation. * @param aliases * An array of aliases. * @param city * The city part of the postal address. * @param company * The name of the company. * @param contact * The name of the contact person for this account. * @param contractNumber * Contract number of the customer. * @param country * The country part of the postal address. * @param createdAt * Creation UTC time RFC3339. * @param customFields * Account's custom properties as key-value pairs. * @param customerNumber * Customer number of the customer. * @param displayName * The display name for the account. * @param email * The company email address for this account. * @param endMarket * Account end market. * @param expiration * Expiration time of the account, as UTC time RFC3339. * @param expirationWarningThreshold * Indicates how many days (1-180) before account expiration a notification email is sent. * @param id * Account ID. * @param idleTimeout * The reference token expiration time, in minutes, for this account. * @param limits * List of limits as key-value pairs if requested. * @param mfaStatus * The enforcement status of multi-factor authentication, either `enforced` or `optional`. * @param notificationEmails * A list of notification email addresses. * @param parentAccount * Represents parent account contact details in responses. * @param parentId * The ID of the parent account, if any. * @param passwordPolicy * The password policy for this account. * @param passwordRecoveryExpiration * Indicates for how many minutes a password recovery email is valid. * @param phoneNumber * The phone number of a company representative. * @param policies * List of policies if requested. * @param postalCode * The postal code part of the postal address. * @param reason * A note with the reason for account status update. * @param referenceNote * A reference note for updating the status of the account. * @param salesContact * Email address of the sales contact. * @param state * The state part of the postal address. * @param status * The status of the account. * @param templateId * Account template ID. * @param tier * The tier level of the account; `0`: free tier, `1`: commercial account, `2`: partner tier. Other * values are reserved for the future. * @param updatedAt * Last update UTC time RFC3339. * @param upgradedAt * Time when upgraded to commercial account in UTC format RFC3339. */ @Internal @SuppressWarnings("PMD.CyclomaticComplexity") public Account(String addressLine1, String addressLine2, String adminEmail, String adminFullName, String adminId, String adminKey, String adminName, String adminPassword, List aliases, String city, String company, String contact, String contractNumber, String country, Date createdAt, Map customFields, String customerNumber, String displayName, String email, String endMarket, Date expiration, @DefaultValue("1") int expirationWarningThreshold, String id, @DefaultValue("1") int idleTimeout, Map limits, AccountMfaStatus mfaStatus, List notificationEmails, ParentAccount parentAccount, String parentId, PasswordPolicy passwordPolicy, @DefaultValue("1") int passwordRecoveryExpiration, String phoneNumber, List policies, String postalCode, String reason, String referenceNote, String salesContact, String state, AccountStatus status, String templateId, String tier, Date updatedAt, Date upgradedAt) { super(); this.adminId = adminId; this.adminKey = adminKey; this.createdAt = createdAt; this.expiration = expiration; this.limits = limits; this.parentAccount = parentAccount; this.parentId = parentId; this.policies = policies; this.reason = reason; this.referenceNote = referenceNote; this.status = status; this.templateId = templateId; this.tier = tier; this.updatedAt = updatedAt; this.upgradedAt = upgradedAt; setAddressLine1(addressLine1); setAddressLine2(addressLine2); setAdminEmail(adminEmail); setAdminFullName(adminFullName); setAdminName(adminName); setAdminPassword(adminPassword); setAliases(aliases); setCity(city); setCompany(company); setContact(contact); setContractNumber(contractNumber); setCountry(country); setCustomFields(customFields); setCustomerNumber(customerNumber); setDisplayName(displayName); setEmail(email); setEndMarket(endMarket); setExpirationWarningThreshold(expirationWarningThreshold); setId(id); setIdleTimeout(idleTimeout); setMfaStatus(mfaStatus); setNotificationEmails(notificationEmails); setPasswordPolicy(passwordPolicy); setPasswordRecoveryExpiration(passwordRecoveryExpiration); setPhoneNumber(phoneNumber); setPostalCode(postalCode); setSalesContact(salesContact); setState(state); } /** * Internal constructor. * *

* Constructor based on a similar object. *

* Note: Should not be used. Use {@link #Account()} instead. * * @param account * an account. */ @Internal public Account(Account account) { this(account == null ? (String) null : account.addressLine1, account == null ? (String) null : account.addressLine2, account == null ? (String) null : account.adminEmail, account == null ? (String) null : account.adminFullName, account == null ? (String) null : account.adminId, account == null ? (String) null : account.adminKey, account == null ? (String) null : account.adminName, account == null ? (String) null : account.adminPassword, account == null ? (List) null : account.aliases, account == null ? (String) null : account.city, account == null ? (String) null : account.company, account == null ? (String) null : account.contact, account == null ? (String) null : account.contractNumber, account == null ? (String) null : account.country, account == null ? new Date() : account.createdAt, account == null ? (Map) null : account.customFields, account == null ? (String) null : account.customerNumber, account == null ? (String) null : account.displayName, account == null ? (String) null : account.email, account == null ? (String) null : account.endMarket, account == null ? new Date() : account.expiration, account == null ? 1 : account.expirationWarningThreshold, account == null ? (String) null : account.id, account == null ? 1 : account.idleTimeout, account == null ? (Map) null : account.limits, account == null ? AccountMfaStatus.getDefault() : account.mfaStatus, account == null ? (List) null : account.notificationEmails, account == null ? (ParentAccount) null : account.parentAccount, account == null ? (String) null : account.parentId, account == null ? (PasswordPolicy) null : account.passwordPolicy, account == null ? 1 : account.passwordRecoveryExpiration, account == null ? (String) null : account.phoneNumber, account == null ? (List) null : account.policies, account == null ? (String) null : account.postalCode, account == null ? (String) null : account.reason, account == null ? (String) null : account.referenceNote, account == null ? (String) null : account.salesContact, account == null ? (String) null : account.state, account == null ? AccountStatus.getDefault() : account.status, account == null ? (String) null : account.templateId, account == null ? (String) null : account.tier, account == null ? new Date() : account.updatedAt, account == null ? new Date() : account.upgradedAt); } /** * Constructor. */ public Account() { this((String) null, (String) null, (String) null, (String) null, (String) null, (String) null, (String) null, (String) null, (List) null, (String) null, (String) null, (String) null, (String) null, (String) null, new Date(), (Map) null, (String) null, (String) null, (String) null, (String) null, new Date(), 1, (String) null, 1, (Map) null, AccountMfaStatus.getDefault(), (List) null, (ParentAccount) null, (String) null, (PasswordPolicy) null, 1, (String) null, (List) null, (String) null, (String) null, (String) null, (String) null, (String) null, AccountStatus.getDefault(), (String) null, (String) null, new Date(), new Date()); } /** * Constructor. * *

* Constructor based on object identifier. *

* * @param id * Account ID. */ public Account(String id) { this(); setId(id); } /** * Internal constructor. * *

* Constructor based on read-only fields. *

* Note: Should not be used. Use {@link #Account()} instead. * * @param adminId * The ID of the admin user created for this account. * @param adminKey * The admin API key created for this account. Present only in the response for account creation. * @param createdAt * Creation UTC time RFC3339. * @param expiration * Expiration time of the account, as UTC time RFC3339. * @param limits * List of limits as key-value pairs if requested. * @param parentAccount * Represents parent account contact details in responses. * @param parentId * The ID of the parent account, if any. * @param policies * List of policies if requested. * @param reason * A note with the reason for account status update. * @param referenceNote * A reference note for updating the status of the account. * @param status * The status of the account. * @param templateId * Account template ID. * @param tier * The tier level of the account; `0`: free tier, `1`: commercial account, `2`: partner tier. Other * values are reserved for the future. * @param updatedAt * Last update UTC time RFC3339. * @param upgradedAt * Time when upgraded to commercial account in UTC format RFC3339. */ @Internal @SuppressWarnings("PMD.CyclomaticComplexity") public Account(String adminId, String adminKey, Date createdAt, Date expiration, Map limits, ParentAccount parentAccount, String parentId, List policies, String reason, String referenceNote, AccountStatus status, String templateId, String tier, Date updatedAt, Date upgradedAt) { this((String) null, (String) null, (String) null, (String) null, adminId, adminKey, (String) null, (String) null, (List) null, (String) null, (String) null, (String) null, (String) null, (String) null, createdAt, (Map) null, (String) null, (String) null, (String) null, (String) null, expiration, 1, (String) null, 1, limits, AccountMfaStatus.getDefault(), (List) null, parentAccount, parentId, (PasswordPolicy) null, 1, (String) null, policies, (String) null, reason, referenceNote, (String) null, (String) null, status, templateId, tier, updatedAt, upgradedAt); } /** * Gets postal address line 1. * * @return addressLine1 */ public String getAddressLine1() { return addressLine1; } /** * Sets postal address line 1. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param addressLine1 * Postal address line 1. */ public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** * Checks whether addressLine1 value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAddressLine1Valid() { return (addressLine1 == null || addressLine1.length() <= 100); } /** * Gets postal address line 2. * * @return addressLine2 */ public String getAddressLine2() { return addressLine2; } /** * Sets postal address line 2. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param addressLine2 * Postal address line 2. */ public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** * Checks whether addressLine2 value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAddressLine2Valid() { return (addressLine2 == null || addressLine2.length() <= 100); } /** * Gets the email address of the admin user created for this account. present only in the response for account * creation. * * @return adminEmail */ public String getAdminEmail() { return adminEmail; } /** * Sets the email address of the admin user created for this account. present only in the response for account * creation. * *

* Note: the length of the string has to match {@code /^(?=.{3,254}$).+@.+/} to be valid * * @param adminEmail * The email address of the admin user created for this account. Present only in the response for account * creation. */ public void setAdminEmail(String adminEmail) { this.adminEmail = adminEmail; } /** * Checks whether adminEmail value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAdminEmailValid() { return (adminEmail == null || adminEmail.matches("^(?=.{3,254}$).+@.+")); } /** * Gets the full name of the admin user created for this account. present only in the response for account creation. * * @return adminFullName */ public String getAdminFullName() { return adminFullName; } /** * Sets the full name of the admin user created for this account. present only in the response for account creation. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param adminFullName * The full name of the admin user created for this account. Present only in the response for account * creation. */ public void setAdminFullName(String adminFullName) { this.adminFullName = adminFullName; } /** * Checks whether adminFullName value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAdminFullNameValid() { return (adminFullName == null || adminFullName.length() <= 100); } /** * Gets the id of the admin user created for this account. * * @return adminId */ public String getAdminId() { return adminId; } /** * Gets the admin api key created for this account. present only in the response for account creation. * * @return adminKey */ public String getAdminKey() { return adminKey; } /** * Gets the username of the admin user created for this account. present only in the response for account creation. * * @return adminName */ public String getAdminName() { return adminName; } /** * Sets the username of the admin user created for this account. present only in the response for account creation. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param adminName * The username of the admin user created for this account. Present only in the response for account * creation. */ public void setAdminName(String adminName) { this.adminName = adminName; } /** * Checks whether adminName value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAdminNameValid() { return (adminName == null || adminName.length() <= 100); } /** * Gets the password of the admin user created for this account. present only in the response for account creation. * * @return adminPassword */ public String getAdminPassword() { return adminPassword; } /** * Sets the password of the admin user created for this account. present only in the response for account creation. * * @param adminPassword * The password of the admin user created for this account. Present only in the response for account * creation. */ public void setAdminPassword(String adminPassword) { this.adminPassword = adminPassword; } /** * Gets an array of aliases. * * @return aliases */ public List getAliases() { return aliases; } /** * Sets an array of aliases. * *

* Note: the number of elements has to be less than or equal to {@code 10} to be valid * * @param aliases * An array of aliases. */ public void setAliases(List aliases) { this.aliases = aliases; } /** * Checks whether aliases value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isAliasesValid() { return (aliases == null || aliases.size() <= 10); } /** * Gets the city part of the postal address. * * @return city */ public String getCity() { return city; } /** * Sets the city part of the postal address. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param city * The city part of the postal address. */ public void setCity(String city) { this.city = city; } /** * Checks whether city value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isCityValid() { return (city == null || city.length() <= 100); } /** * Gets the name of the company. * * @return company */ public String getCompany() { return company; } /** * Sets the name of the company. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param company * The name of the company. */ public void setCompany(String company) { this.company = company; } /** * Checks whether company value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isCompanyValid() { return (company == null || company.length() <= 100); } /** * Gets the name of the contact person for this account. * * @return contact */ public String getContact() { return contact; } /** * Sets the name of the contact person for this account. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param contact * The name of the contact person for this account. */ public void setContact(String contact) { this.contact = contact; } /** * Checks whether contact value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isContactValid() { return (contact == null || contact.length() <= 100); } /** * Gets contract number of the customer. * * @return contractNumber */ public String getContractNumber() { return contractNumber; } /** * Sets contract number of the customer. * * @param contractNumber * Contract number of the customer. */ public void setContractNumber(String contractNumber) { this.contractNumber = contractNumber; } /** * Gets the country part of the postal address. * * @return country */ public String getCountry() { return country; } /** * Sets the country part of the postal address. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param country * The country part of the postal address. */ public void setCountry(String country) { this.country = country; } /** * Checks whether country value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isCountryValid() { return (country == null || country.length() <= 100); } /** * Gets creation utc time rfc3339. * * @return createdAt */ public Date getCreatedAt() { return createdAt; } /** * Gets account's custom properties as key-value pairs. * * @return customFields */ public Map getCustomFields() { return customFields; } /** * Sets account's custom properties as key-value pairs. * * @param customFields * Account's custom properties as key-value pairs. */ public void setCustomFields(Map customFields) { this.customFields = customFields; } /** * Gets customer number of the customer. * * @return customerNumber */ public String getCustomerNumber() { return customerNumber; } /** * Sets customer number of the customer. * * @param customerNumber * Customer number of the customer. */ public void setCustomerNumber(String customerNumber) { this.customerNumber = customerNumber; } /** * Gets the display name for the account. * * @return displayName */ public String getDisplayName() { return displayName; } /** * Sets the display name for the account. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param displayName * The display name for the account. */ public void setDisplayName(String displayName) { this.displayName = displayName; } /** * Checks whether displayName value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isDisplayNameValid() { return (displayName == null || displayName.length() <= 100); } /** * Gets the company email address for this account. * * @return email */ public String getEmail() { return email; } /** * Sets the company email address for this account. * *

* Note: the length of the string has to match {@code /^(?=.{3,254}$).+@.+/} to be valid * * @param email * The company email address for this account. */ public void setEmail(String email) { this.email = email; } /** * Checks whether email value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isEmailValid() { return (email == null || email.matches("^(?=.{3,254}$).+@.+")); } /** * Gets account end market. * * @return endMarket */ public String getEndMarket() { return endMarket; } /** * Sets account end market. * * @param endMarket * Account end market. */ @Required public void setEndMarket(String endMarket) { this.endMarket = endMarket; } /** * Checks whether endMarket value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isEndMarketValid() { return endMarket != null; } /** * Gets expiration time of the account, as utc time rfc3339. * * @return expiration */ public Date getExpiration() { return expiration; } /** * Gets indicates how many days (1-180) before account expiration a notification email is sent. * * @return expirationWarningThreshold */ public int getExpirationWarningThreshold() { return expirationWarningThreshold; } /** * Sets indicates how many days (1-180) before account expiration a notification email is sent. * *

* Note: the value has to be greater than or equal to {@code 1} to be valid *

* Note: the value has to be less than or equal to {@code 180} to be valid * * @param expirationWarningThreshold * Indicates how many days (1-180) before account expiration a notification email is sent. */ public void setExpirationWarningThreshold(@DefaultValue("1") int expirationWarningThreshold) { this.expirationWarningThreshold = expirationWarningThreshold; } /** * Checks whether expirationWarningThreshold value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isExpirationWarningThresholdValid() { return (expirationWarningThreshold >= 1) && (expirationWarningThreshold <= 180); } /** * Gets account id. * * @return id */ @Override public String getId() { return id; } /** * Sets account id. * *

* Note: the length of the string has to match {@code /[a-f0-9]{32}/} to be valid * * @param id * Account ID. */ @Override public void setId(String id) { this.id = id; } /** * Sets account id. * *

* Similar to {@link #setId(String)} *

* Note: the length of the string has to match {@code /[a-f0-9]{32}/} to be valid * * @param accountId * Account ID. */ @Internal public void setAccountId(String accountId) { setId(accountId); } /** * Checks whether id value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isIdValid() { return (id == null || id.matches("[a-f0-9]{32}")); } /** * Gets the reference token expiration time, in minutes, for this account. * * @return idleTimeout */ public int getIdleTimeout() { return idleTimeout; } /** * Sets the reference token expiration time, in minutes, for this account. * *

* Note: the value has to be greater than or equal to {@code 1} to be valid *

* Note: the value has to be less than or equal to {@code 120} to be valid * * @param idleTimeout * The reference token expiration time, in minutes, for this account. */ public void setIdleTimeout(@DefaultValue("1") int idleTimeout) { this.idleTimeout = idleTimeout; } /** * Checks whether idleTimeout value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isIdleTimeoutValid() { return (idleTimeout >= 1) && (idleTimeout <= 120); } /** * Gets list of limits as key-value pairs if requested. * * @return limits */ public Map getLimits() { return limits; } /** * Gets the enforcement status of multi-factor authentication, either `enforced` or `optional`. * * @return mfaStatus */ public AccountMfaStatus getMfaStatus() { return mfaStatus; } /** * Sets the enforcement status of multi-factor authentication, either `enforced` or `optional`. * * @param mfaStatus * The enforcement status of multi-factor authentication, either `enforced` or `optional`. */ public void setMfaStatus(AccountMfaStatus mfaStatus) { this.mfaStatus = mfaStatus; } /** * Sets the enforcement status of multi-factor authentication, either `enforced` or `optional`. * *

* Similar to {@link #setMfaStatus(com.arm.mbed.cloud.sdk.accounts.model.AccountMfaStatus)} * * @param mfaStatus * The enforcement status of multi-factor authentication, either `enforced` or `optional`. */ @Internal public void setMfaStatus(String mfaStatus) { this.mfaStatus = AccountMfaStatus.getValue(mfaStatus); } /** * Gets a list of notification email addresses. * * @return notificationEmails */ public List getNotificationEmails() { return notificationEmails; } /** * Sets a list of notification email addresses. * * @param notificationEmails * A list of notification email addresses. */ public void setNotificationEmails(List notificationEmails) { this.notificationEmails = notificationEmails; } /** * Gets represents parent account contact details in responses. * * @return parentAccount */ public ParentAccount getParentAccount() { return parentAccount; } /** * Gets the id of the parent account, if any. * * @return parentId */ public String getParentId() { return parentId; } /** * Gets the password policy for this account. * * @return passwordPolicy */ public PasswordPolicy getPasswordPolicy() { return passwordPolicy; } /** * Sets the password policy for this account. * * @param passwordPolicy * The password policy for this account. */ public void setPasswordPolicy(PasswordPolicy passwordPolicy) { this.passwordPolicy = passwordPolicy; } /** * Gets indicates for how many minutes a password recovery email is valid. * * @return passwordRecoveryExpiration */ public int getPasswordRecoveryExpiration() { return passwordRecoveryExpiration; } /** * Sets indicates for how many minutes a password recovery email is valid. * *

* Note: the value has to be greater than or equal to {@code 1} to be valid *

* Note: the value has to be less than or equal to {@code 45} to be valid * * @param passwordRecoveryExpiration * Indicates for how many minutes a password recovery email is valid. */ public void setPasswordRecoveryExpiration(@DefaultValue("1") int passwordRecoveryExpiration) { this.passwordRecoveryExpiration = passwordRecoveryExpiration; } /** * Checks whether passwordRecoveryExpiration value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isPasswordRecoveryExpirationValid() { return (passwordRecoveryExpiration >= 1) && (passwordRecoveryExpiration <= 45); } /** * Gets the phone number of a company representative. * * @return phoneNumber */ public String getPhoneNumber() { return phoneNumber; } /** * Sets the phone number of a company representative. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param phoneNumber * The phone number of a company representative. */ public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** * Checks whether phoneNumber value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isPhoneNumberValid() { return (phoneNumber == null || phoneNumber.length() <= 100); } /** * Gets list of policies if requested. * * @return policies */ public List getPolicies() { return policies; } /** * Gets the postal code part of the postal address. * * @return postalCode */ public String getPostalCode() { return postalCode; } /** * Sets the postal code part of the postal address. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param postalCode * The postal code part of the postal address. */ public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** * Checks whether postalCode value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isPostalCodeValid() { return (postalCode == null || postalCode.length() <= 100); } /** * Gets a note with the reason for account status update. * * @return reason */ public String getReason() { return reason; } /** * Gets a reference note for updating the status of the account. * * @return referenceNote */ public String getReferenceNote() { return referenceNote; } /** * Gets email address of the sales contact. * * @return salesContact */ public String getSalesContact() { return salesContact; } /** * Sets email address of the sales contact. * *

* Note: the length of the string has to match {@code /^(?=.{3,254}$).+@.+/} to be valid * * @param salesContact * Email address of the sales contact. */ public void setSalesContact(String salesContact) { this.salesContact = salesContact; } /** * Checks whether salesContact value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isSalesContactValid() { return (salesContact == null || salesContact.matches("^(?=.{3,254}$).+@.+")); } /** * Gets the state part of the postal address. * * @return state */ public String getState() { return state; } /** * Sets the state part of the postal address. * *

* Note: the length of the string has to be less than or equal to {@code 100} to be valid * * @param state * The state part of the postal address. */ public void setState(String state) { this.state = state; } /** * Checks whether state value is valid. * * @return true if the value is valid; false otherwise. */ @SuppressWarnings("PMD.UselessParentheses") public boolean isStateValid() { return (state == null || state.length() <= 100); } /** * Gets the status of the account. * * @return status */ public AccountStatus getStatus() { return status; } /** * Gets account template id. * * @return templateId */ public String getTemplateId() { return templateId; } /** * Gets the tier level of the account; `0`: free tier, `1`: commercial account, `2`: partner tier. other values are * reserved for the future. * * @return tier */ public String getTier() { return tier; } /** * Gets last update utc time rfc3339. * * @return updatedAt */ public Date getUpdatedAt() { return updatedAt; } /** * Gets time when upgraded to commercial account in utc format rfc3339. * * @return upgradedAt */ public Date getUpgradedAt() { return upgradedAt; } /** * Returns a string representation of the object. * *

* * @see java.lang.Object#toString() * @return the string representation */ @Override public String toString() { return "Account [addressLine1=" + addressLine1 + ", addressLine2=" + addressLine2 + ", adminEmail=" + adminEmail + ", adminFullName=" + adminFullName + ", adminId=" + adminId + ", adminKey=" + adminKey + ", adminName=" + adminName + ", adminPassword=" + adminPassword + ", aliases=" + aliases + ", city=" + city + ", company=" + company + ", contact=" + contact + ", contractNumber=" + contractNumber + ", country=" + country + ", createdAt=" + createdAt + ", customFields=" + customFields + ", customerNumber=" + customerNumber + ", displayName=" + displayName + ", email=" + email + ", endMarket=" + endMarket + ", expiration=" + expiration + ", expirationWarningThreshold=" + expirationWarningThreshold + ", id=" + id + ", idleTimeout=" + idleTimeout + ", limits=" + limits + ", mfaStatus=" + mfaStatus + ", notificationEmails=" + notificationEmails + ", parentAccount=" + parentAccount + ", parentId=" + parentId + ", passwordPolicy=" + passwordPolicy + ", passwordRecoveryExpiration=" + passwordRecoveryExpiration + ", phoneNumber=" + phoneNumber + ", policies=" + policies + ", postalCode=" + postalCode + ", reason=" + reason + ", referenceNote=" + referenceNote + ", salesContact=" + salesContact + ", state=" + state + ", status=" + status + ", templateId=" + templateId + ", tier=" + tier + ", updatedAt=" + updatedAt + ", upgradedAt=" + upgradedAt + "]"; } /** * Calculates the hash code of this instance based on field values. * *

* * @see java.lang.Object#hashCode() * @return hash code */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addressLine1 == null) ? 0 : addressLine1.hashCode()); result = prime * result + ((addressLine2 == null) ? 0 : addressLine2.hashCode()); result = prime * result + ((adminEmail == null) ? 0 : adminEmail.hashCode()); result = prime * result + ((adminFullName == null) ? 0 : adminFullName.hashCode()); result = prime * result + ((adminId == null) ? 0 : adminId.hashCode()); result = prime * result + ((adminKey == null) ? 0 : adminKey.hashCode()); result = prime * result + ((adminName == null) ? 0 : adminName.hashCode()); result = prime * result + ((adminPassword == null) ? 0 : adminPassword.hashCode()); result = prime * result + ((aliases == null) ? 0 : aliases.hashCode()); result = prime * result + ((city == null) ? 0 : city.hashCode()); result = prime * result + ((company == null) ? 0 : company.hashCode()); result = prime * result + ((contact == null) ? 0 : contact.hashCode()); result = prime * result + ((contractNumber == null) ? 0 : contractNumber.hashCode()); result = prime * result + ((country == null) ? 0 : country.hashCode()); result = prime * result + ((createdAt == null) ? 0 : createdAt.hashCode()); result = prime * result + ((customFields == null) ? 0 : customFields.hashCode()); result = prime * result + ((customerNumber == null) ? 0 : customerNumber.hashCode()); result = prime * result + ((displayName == null) ? 0 : displayName.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((endMarket == null) ? 0 : endMarket.hashCode()); result = prime * result + ((expiration == null) ? 0 : expiration.hashCode()); result = prime * result + Objects.hashCode(Integer.valueOf(expirationWarningThreshold)); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + Objects.hashCode(Integer.valueOf(idleTimeout)); result = prime * result + ((limits == null) ? 0 : limits.hashCode()); result = prime * result + ((mfaStatus == null) ? 0 : mfaStatus.hashCode()); result = prime * result + ((notificationEmails == null) ? 0 : notificationEmails.hashCode()); result = prime * result + ((parentAccount == null) ? 0 : parentAccount.hashCode()); result = prime * result + ((parentId == null) ? 0 : parentId.hashCode()); result = prime * result + ((passwordPolicy == null) ? 0 : passwordPolicy.hashCode()); result = prime * result + Objects.hashCode(Integer.valueOf(passwordRecoveryExpiration)); result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode()); result = prime * result + ((policies == null) ? 0 : policies.hashCode()); result = prime * result + ((postalCode == null) ? 0 : postalCode.hashCode()); result = prime * result + ((reason == null) ? 0 : reason.hashCode()); result = prime * result + ((referenceNote == null) ? 0 : referenceNote.hashCode()); result = prime * result + ((salesContact == null) ? 0 : salesContact.hashCode()); result = prime * result + ((state == null) ? 0 : state.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((templateId == null) ? 0 : templateId.hashCode()); result = prime * result + ((tier == null) ? 0 : tier.hashCode()); result = prime * result + ((updatedAt == null) ? 0 : updatedAt.hashCode()); result = prime * result + ((upgradedAt == null) ? 0 : upgradedAt.hashCode()); return result; } /** * Method to ensure {@link #equals(Object)} is correct. * *

* Note: see this article: canEqual() * * @param other * another object. * @return true if the other object is an instance of the class in which canEqual is (re)defined, false otherwise. */ protected boolean canEqual(Object other) { return other instanceof Account; } /** * Indicates whether some other object is "equal to" this one. * *

* * @see java.lang.Object#equals(java.lang.Object) * @param obj * an object to compare with this instance. * @return true if this object is the same as the obj argument; false otherwise. */ @Override @SuppressWarnings({ "PMD.ExcessiveMethodLength", "PMD.NcssMethodCount" }) public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Account)) { return false; } final Account other = (Account) obj; if (!other.canEqual(this)) { return false; } if (addressLine1 == null) { if (other.addressLine1 != null) { return false; } } else if (!addressLine1.equals(other.addressLine1)) { return false; } if (addressLine2 == null) { if (other.addressLine2 != null) { return false; } } else if (!addressLine2.equals(other.addressLine2)) { return false; } if (adminEmail == null) { if (other.adminEmail != null) { return false; } } else if (!adminEmail.equals(other.adminEmail)) { return false; } if (adminFullName == null) { if (other.adminFullName != null) { return false; } } else if (!adminFullName.equals(other.adminFullName)) { return false; } if (adminId == null) { if (other.adminId != null) { return false; } } else if (!adminId.equals(other.adminId)) { return false; } if (adminKey == null) { if (other.adminKey != null) { return false; } } else if (!adminKey.equals(other.adminKey)) { return false; } if (adminName == null) { if (other.adminName != null) { return false; } } else if (!adminName.equals(other.adminName)) { return false; } if (adminPassword == null) { if (other.adminPassword != null) { return false; } } else if (!adminPassword.equals(other.adminPassword)) { return false; } if (aliases == null) { if (other.aliases != null) { return false; } } else if (!aliases.equals(other.aliases)) { return false; } if (city == null) { if (other.city != null) { return false; } } else if (!city.equals(other.city)) { return false; } if (company == null) { if (other.company != null) { return false; } } else if (!company.equals(other.company)) { return false; } if (contact == null) { if (other.contact != null) { return false; } } else if (!contact.equals(other.contact)) { return false; } if (contractNumber == null) { if (other.contractNumber != null) { return false; } } else if (!contractNumber.equals(other.contractNumber)) { return false; } if (country == null) { if (other.country != null) { return false; } } else if (!country.equals(other.country)) { return false; } if (createdAt == null) { if (other.createdAt != null) { return false; } } else if (!createdAt.equals(other.createdAt)) { return false; } if (customFields == null) { if (other.customFields != null) { return false; } } else if (!customFields.equals(other.customFields)) { return false; } if (customerNumber == null) { if (other.customerNumber != null) { return false; } } else if (!customerNumber.equals(other.customerNumber)) { return false; } if (displayName == null) { if (other.displayName != null) { return false; } } else if (!displayName.equals(other.displayName)) { return false; } if (email == null) { if (other.email != null) { return false; } } else if (!email.equals(other.email)) { return false; } if (endMarket == null) { if (other.endMarket != null) { return false; } } else if (!endMarket.equals(other.endMarket)) { return false; } if (expiration == null) { if (other.expiration != null) { return false; } } else if (!expiration.equals(other.expiration)) { return false; } if (expirationWarningThreshold != other.expirationWarningThreshold) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (idleTimeout != other.idleTimeout) { return false; } if (limits == null) { if (other.limits != null) { return false; } } else if (!limits.equals(other.limits)) { return false; } if (mfaStatus != other.mfaStatus) { return false; } if (notificationEmails == null) { if (other.notificationEmails != null) { return false; } } else if (!notificationEmails.equals(other.notificationEmails)) { return false; } if (parentAccount == null) { if (other.parentAccount != null) { return false; } } else if (!parentAccount.equals(other.parentAccount)) { return false; } if (parentId == null) { if (other.parentId != null) { return false; } } else if (!parentId.equals(other.parentId)) { return false; } if (passwordPolicy == null) { if (other.passwordPolicy != null) { return false; } } else if (!passwordPolicy.equals(other.passwordPolicy)) { return false; } if (passwordRecoveryExpiration != other.passwordRecoveryExpiration) { return false; } if (phoneNumber == null) { if (other.phoneNumber != null) { return false; } } else if (!phoneNumber.equals(other.phoneNumber)) { return false; } if (policies == null) { if (other.policies != null) { return false; } } else if (!policies.equals(other.policies)) { return false; } if (postalCode == null) { if (other.postalCode != null) { return false; } } else if (!postalCode.equals(other.postalCode)) { return false; } if (reason == null) { if (other.reason != null) { return false; } } else if (!reason.equals(other.reason)) { return false; } if (referenceNote == null) { if (other.referenceNote != null) { return false; } } else if (!referenceNote.equals(other.referenceNote)) { return false; } if (salesContact == null) { if (other.salesContact != null) { return false; } } else if (!salesContact.equals(other.salesContact)) { return false; } if (state == null) { if (other.state != null) { return false; } } else if (!state.equals(other.state)) { return false; } if (status != other.status) { return false; } if (templateId == null) { if (other.templateId != null) { return false; } } else if (!templateId.equals(other.templateId)) { return false; } if (tier == null) { if (other.tier != null) { return false; } } else if (!tier.equals(other.tier)) { return false; } if (updatedAt == null) { if (other.updatedAt != null) { return false; } } else if (!updatedAt.equals(other.updatedAt)) { return false; } if (upgradedAt == null) { if (other.upgradedAt != null) { return false; } } else if (!upgradedAt.equals(other.upgradedAt)) { return false; } return true; } /** * Checks whether the model is valid or not. * *

* * @see SdkModel#isValid() * @return true if the model is valid; false otherwise. */ @Override public boolean isValid() { return isAddressLine1Valid() && isAddressLine2Valid() && isAdminEmailValid() && isAdminFullNameValid() && isAdminNameValid() && isAliasesValid() && isCityValid() && isCompanyValid() && isContactValid() && isCountryValid() && isDisplayNameValid() && isEmailValid() && isEndMarketValid() && isExpirationWarningThresholdValid() && isIdValid() && isIdleTimeoutValid() && isPasswordRecoveryExpirationValid() && isPhoneNumberValid() && isPostalCodeValid() && isSalesContactValid() && isStateValid(); } /** * Clones this instance. * *

* * @see java.lang.Object#clone() * @return a cloned instance */ @Override public Account clone() { return new Account(this); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy