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

com.onegini.sdk.model.config.v2.organisations.Organisation 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.organisations;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
import static com.onegini.sdk.api.ErrorMessageConstants.MUST_BE_SPECIFIED;
import static com.onegini.sdk.api.ValidationConstants.ID_REGEX;
import static com.onegini.sdk.api.ValidationConstants.MAX_COMMON_COLUMN_LENGTH;

import java.util.Collection;
import java.util.Map;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import com.neovisionaries.i18n.LocaleCode;
import com.onegini.sdk.model.config.v2.ObjectWithId;
import com.onegini.sdk.model.config.v2.organisations.attributes.IdentityAttribute;
import com.onegini.sdk.model.config.v2.organisations.attributes.UserProfileAttributes;
import com.onegini.sdk.model.config.v2.organisations.sp.ServiceProvider;
import com.onegini.sdk.saml.ManageableAttribute;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(NON_NULL)
public class Organisation implements ObjectWithId, ObjectWithIdentityAttributes {

  @JsonProperty("id")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  @NotEmpty(message = "id " + MUST_BE_SPECIFIED)
  @Pattern(regexp = ID_REGEX, message = "Invalid id")
  private String id;

  @JsonProperty("name")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String name;

  @JsonProperty("landing_page_url")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String landingPageUrl;

  @JsonProperty("site_url")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String siteUrl;

  @JsonProperty("support_url")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String supportUrl;

  @JsonProperty("support_email")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String supportEmail;

  @JsonProperty("account_link_url")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String accountLinkUrl;

  @JsonProperty("notify_when_user_does_unlink_account")
  private Boolean notifyWhenUserDoesUnlinkAccount;

  @JsonProperty("username_for_basic_auth")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String usernameForBasicAuth;

  @JsonProperty("preferred_language")
  private LocaleCode preferredLanguage;

  @JsonProperty("message_to_assist_user_during_migration_period_html")
  @Size(max = MAX_COMMON_COLUMN_LENGTH)
  private String messageToAssistUserDuringMigrationPeriodHtml;

  @JsonProperty("is_private")
  private Boolean isPrivate;

  @JsonProperty("logo_square_base64")
  private String logoSquareBase64;

  @JsonProperty("logo_landscape_base64")
  private String logoLandscapeBase64;

  @JsonProperty("service_providers")
  @Valid
  private Collection serviceProviders;

  @JsonProperty("user_profile_attributes")
  @Valid
  private UserProfileAttributes userProfileAttributes;

  @JsonIgnore
  @Override
  public Map getIdentityAttributes() {
    return userProfileAttributes != null ? userProfileAttributes.getIdentityAttributes() : ImmutableMap.of();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy