Skip to content

Commit

Permalink
feat(jans-config-api): user mgmt endpoint -wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pujavs committed Mar 29, 2022
1 parent aadbf8b commit ac35327
Show file tree
Hide file tree
Showing 14 changed files with 1,433 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/

package io.jans.configapi.model.user;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.jans.orm.annotation.AttributeName;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Address {

public enum Type {WORK, HOME, OTHER}

@AttributeName(name = "formatted")
private String formatted;

@AttributeName(name = "streetAddress")
private String streetAddress;

@AttributeName(name = "locality")
private String locality;

@AttributeName(name = "region")
private String region;

@AttributeName(name = "postalCode")
private String postalCode;

@AttributeName(name = "country")
private String country;

@AttributeName(name = "type")
private String type;

@AttributeName(name = "primary")
private Boolean primary;

public String getFormatted() {
return formatted;
}

public void setFormatted(String formatted) {
this.formatted = formatted;
}

public String getStreetAddress() {
return streetAddress;
}

public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}

public String getLocality() {
return locality;
}

public void setLocality(String locality) {
this.locality = locality;
}

public String getRegion() {
return region;
}

public void setRegion(String region) {
this.region = region;
}

public String getPostalCode() {
return postalCode;
}

public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public void setType(Type type){
setType(type.name().toLowerCase());
}

public Boolean getPrimary() {
return primary;
}

public void setPrimary(Boolean primary) {
this.primary = primary;
}

@Override
public String toString() {
return "Address [formatted=" + formatted + ", streetAddress=" + streetAddress + ", locality=" + locality
+ ", region=" + region + ", postalCode=" + postalCode + ", country=" + country + ", type=" + type
+ ", primary=" + primary + "]";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/

package io.jans.configapi.model.user;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.jans.orm.annotation.AttributeName;


public class Device {
private String addedOn;

private String id;

private String nickName;

private boolean soft = false;

public String getAddedOn() {
return addedOn;
}

public void setAddedOn(String addedOn) {
this.addedOn = addedOn;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getNickName() {
return nickName;
}

@Override
public String toString() {
return "Device [addedOn=" + addedOn + ", id=" + id + ", nickName=" + nickName + ", soft=" + soft + "]";
}

public void setNickName(String nickName) {
this.nickName = nickName;
}

public boolean isSoft() {
return soft;
}

public void setSoft(boolean soft) {
this.soft = soft;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/

package io.jans.configapi.model.user;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.jans.orm.annotation.AttributeName;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Email {

public enum Type {WORK, HOME, OTHER}

@AttributeName(name = "value")
private String value;

@AttributeName(name = "display")
private String display;

@AttributeName(name = "type")
private String type;

@AttributeName(name = "primary")
private Boolean primary;

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getDisplay() {
return display;
}

public void setDisplay(String display) {
this.display = display;
}

public String getType() {
return type;
}

@JsonProperty
public void setType(String type) {
this.type = type;
}

public void setType(Type type){
setType(type.name().toLowerCase());
}

public Boolean getPrimary() {
return primary;
}

public void setPrimary(Boolean primary) {
this.primary = primary;
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((value == null) ? 0 : value.hashCode());
result = prime * result + ((display == null) ? 0 : display.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((primary == null) ? 0 : primary.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Email other = (Email) obj;
if (value == null) {
if (other.value != null) {
return false;
}
} else if (!value.equals(other.value)) {
return false;
}
if (display == null) {
if (other.display != null) {
return false;
}
} else if (!display.equals(other.display)) {
return false;
}
if (type == null) {
if (other.type != null) {
return false;
}
} else if (!type.equals(other.type)) {
return false;
}
if (primary == null) {
if (other.primary != null) {
return false;
}
} else if (!primary.equals(other.primary)) {
return false;
}
return true;
}

@Override
public String toString() {
return "Email [value=" + value + ", display=" + display + ", type=" + type + ", primary=" + primary + "]";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/
package io.jans.configapi.model.user;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.jans.orm.annotation.AttributeName;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Entitlement {

@AttributeName(name = "value")
private String value;

@AttributeName(name = "display")
private String display;

@AttributeName(name = "type")
private String type;

@AttributeName(name = "primary")
private Boolean primary;

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getDisplay() {
return display;
}

public void setDisplay(String display) {
this.display = display;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public Boolean getPrimary() {
return primary;
}

public void setPrimary(Boolean primary) {
this.primary = primary;
}

@Override
public String toString() {
return "Entitlement [value=" + value + ", display=" + display + ", type=" + type + ", primary=" + primary + "]";
}

}
Loading

0 comments on commit ac35327

Please sign in to comment.