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

com.onegini.sdk.model.config.v2.features.Features Maven / Gradle / Ivy

There is a newer version: 5.92.0
Show newest version
/*
 * Copyright 2013-2020 Onegini b.v.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.onegini.sdk.model.config.v2.features;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
import static com.onegini.sdk.model.config.v2.validation.DependentOptionsValidator.isDependentOptionForUpdateValid;

import javax.validation.Valid;
import javax.validation.constraints.AssertTrue;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.onegini.sdk.model.config.v2.features.actiontoken.ActionToken;
import com.onegini.sdk.model.config.v2.features.activation.PersonActivation;
import com.onegini.sdk.model.config.v2.features.email.CustomEmailValidation;
import com.onegini.sdk.model.config.v2.features.invitation.InvitationVerificationRequired;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(NON_NULL)
public class Features {

  @JsonProperty("login_enabled")
  private Boolean loginEnabled;

  @JsonProperty("sign_up_enabled")
  private Boolean signUpEnabled;

  @JsonProperty("automated_external_identity_coupling_enabled")
  private Boolean automatedExternalIdentityCouplingEnabled;

  @JsonProperty("bind_multiple_external_accounts_with_one_cim_account")
  private Boolean bindMultipleExternalAccountsWithOneCimAccount;

  @JsonProperty("accepting_invitation_enabled")
  private Boolean acceptingInvitationEnabled;

  @JsonProperty("post_login_extra_registration_after_second_login")
  private Boolean postLoginExtraRegistrationAfterSecondLogin;

  @Valid
  @JsonProperty("action_token")
  private ActionToken actionToken;

  @Valid
  @JsonProperty("person_activation")
  private PersonActivation personActivation;

  @JsonProperty("password_reset_enabled")
  private Boolean passwordResetEnabled;

  @JsonProperty("username_reminder_via_sms_enabled")
  private Boolean usernameReminderViaSmsEnabled;

  @JsonProperty("mobile_number_validation_backend_services_enabled")
  private Boolean mobileNumberValidationBackendServicesEnabled;

  @Valid
  @JsonProperty("custom_email_validation")
  private CustomEmailValidation customEmailValidation;

  @JsonProperty("migration_enabled")
  private Boolean migrationEnabled;

  @JsonProperty("unauthenticated_migration_enabled")
  private Boolean unauthenticatedMigrationEnabled;

  @JsonProperty("person_identifier_in_external_profile_required_for_migration")
  private Boolean personIdentifierInExternalProfileRequiredForMigration;

  @Valid
  @JsonProperty("invitation_verification_required")
  private InvitationVerificationRequired invitationVerificationRequired;

  @JsonProperty("allow_sign_up_without_invitation_validation")
  private Boolean allowSignUpWithoutInvitationValidation;

  @JsonProperty("pin_enabled")
  private Boolean pinEnabled;

  @JsonProperty("sms_enabled")
  private Boolean smsEnabled;

  @JsonProperty("google_authenticator_step_up_authentication_enabled")
  private Boolean googleAuthenticatorStepUpAuthenticationEnabled;

  @JsonProperty("mobile_authentication_enabled")
  private Boolean mobileAuthenticationEnabled;

  @JsonProperty("step_up_authentication_method_externally_delivered_code_enabled")
  private Boolean stepUpAuthenticationMethodExternallyDeliveredCodeEnabled;

  @JsonProperty("cookie_based_saml_authentication")
  private Boolean cookieBasedSamlAuthn;

  @JsonProperty("import_api_enabled")
  private Boolean importApiEnabled;

  @JsonProperty("operations_api_enabled")
  private Boolean operationsApiEnabled;

  @JsonProperty("person_api_enabled")
  private Boolean personApiEnabled;

  @JsonProperty("credentials_api_enabled")
  private Boolean credentialsApiEnabled;

  @JsonProperty("configuration_api_enabled")
  private Boolean configurationApiEnabled;

  @JsonProperty("events_api_enabled")
  private Boolean eventsApiEnabled;

  @JsonProperty("statistics_api_enabled")
  private Boolean statisticsApiEnabled;

  @JsonProperty("session_api_enabled")
  private Boolean sessionApiEnabled;

  @JsonProperty("storage_api_enabled")
  private Boolean storageApiEnabled;

  @JsonProperty("experimental_features_enabled")
  private Boolean experimentalFeaturesEnabled;

  @JsonIgnore
  @AssertTrue(message = "bind_multiple_external_accounts_with_one_cim_account requires automated_external_identity_coupling_enabled to be enabled or bind_multiple_external_accounts_with_one_cim_account not specified")
  public boolean isAutomaticCouplingSetupValid() {
    return isDependentOptionForUpdateValid(bindMultipleExternalAccountsWithOneCimAccount, automatedExternalIdentityCouplingEnabled);
  }

  @JsonIgnore
  @AssertTrue(message = "unauthenticated_migration_enabled requires migration_enabled to be set to true or unauthenticated_migration_enabled not specified")
  public boolean isMigrationSetupValid() {
    return isDependentOptionForUpdateValid(unauthenticatedMigrationEnabled, migrationEnabled);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy