Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
slavikm committed Jul 10, 2024
1 parent c4385fa commit 6f4ed7b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 39 deletions.
69 changes: 32 additions & 37 deletions src/main/java/com/descope/model/user/request/PatchUserRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,47 @@
import static com.descope.utils.CollectionUtils.addIfNotNull;

import com.descope.model.auth.AssociatedTenant;
import com.descope.utils.MgmtUtils;

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;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class PatchUserRequest {
String name;
String givenName;
String middleName;
String familyName;
String phone;
String email;
List<String> roleNames;
List<AssociatedTenant> userTenants;
Map<String, Object> customAttributes;
String picture;
Boolean verifiedEmail;
Boolean verifiedPhone;
List<String> ssoAppIds;
String name;
String givenName;
String middleName;
String familyName;
String phone;
String email;
List<String> roleNames;
List<AssociatedTenant> userTenants;
Map<String, Object> customAttributes;
String picture;
Boolean verifiedEmail;
Boolean verifiedPhone;
List<String> ssoAppIds;

public Map<String, Object> toMap() {
Map<String, Object> m = new HashMap<>();
addIfNotNull(m, "email", email);
addIfNotNull(m, "verifiedEmail", verifiedEmail);
addIfNotNull(m, "phone", phone);
addIfNotNull(m, "verifiedPhone", verifiedPhone);
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, "ssoAppIDs", ssoAppIds);
return m;
}
public Map<String, Object> toMap() {
Map<String, Object> m = new HashMap<>();
addIfNotNull(m, "email", email);
addIfNotNull(m, "verifiedEmail", verifiedEmail);
addIfNotNull(m, "phone", phone);
addIfNotNull(m, "verifiedPhone", verifiedPhone);
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, "ssoAppIDs", ssoAppIds);
return m;
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/descope/sdk/mgmt/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public interface UserService {

/**
* Patches an existing user.
* <p>
* Only the fields that are set in the request will be updated.
*
* <p>Only the fields that are set in the request will be updated.
*
* @param loginId The loginID is required and will determine which user to update.
* @param request The request containing the fields to be updated. Fields not set will remain unchanged.
Expand Down

0 comments on commit 6f4ed7b

Please sign in to comment.