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

com.descope.model.user.request.UserRequest Maven / Gradle / Ivy

There is a newer version: 1.0.30
Show newest version
package com.descope.model.user.request;

import static com.descope.utils.CollectionUtils.addIfNotNull;

import com.descope.model.auth.AssociatedTenant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class UserRequest {
  String email;
  Boolean verifiedEmail;
  String phone;
  Boolean verifiedPhone;
  String displayName;
  String givenName;
  String middleName;
  String familyName;
  List roleNames;
  List userTenants;
  Map customAttributes;
  String picture;
  Boolean test;
  List additionalLoginIds;
  List ssoAppIds;

  public Map toMap() {
    Map m = new HashMap<>();
    addIfNotNull(m, "email", email);
    addIfNotNull(m, "verifiedEmail", verifiedEmail);
    addIfNotNull(m, "phone", phone);
    addIfNotNull(m, "verifiedPhone", verifiedPhone);
    addIfNotNull(m, "displayName", displayName);
    addIfNotNull(m, "givenName", givenName);
    addIfNotNull(m, "middleName", middleName);
    addIfNotNull(m, "familyName", familyName);
    addIfNotNull(m, "roleNames", roleNames);
    addIfNotNull(m, "userTenants", userTenants);
    addIfNotNull(m, "customAttributes", customAttributes);
    addIfNotNull(m, "picture", picture);
    addIfNotNull(m, "test", test);
    addIfNotNull(m, "additionalLoginIds", additionalLoginIds);
    addIfNotNull(m, "ssoAppIDs", ssoAppIds);
    return m;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy