|
| 1 | +/* |
| 2 | + * MIT License |
| 3 | + * |
| 4 | + * Copyright (c) 2026 Hydrologic Engineering Center |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in all |
| 14 | + * copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | + * SOFTWARE. |
| 23 | + */ |
| 24 | + |
| 25 | +package mil.army.usace.hec.cwms.data.api.client.model; |
| 26 | + |
| 27 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 28 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 29 | +import jakarta.validation.Valid; |
| 30 | +import java.util.HashMap; |
| 31 | +import java.util.List; |
| 32 | +import java.util.Map; |
| 33 | +import java.util.Objects; |
| 34 | + |
| 35 | +/** |
| 36 | + * User |
| 37 | + */ |
| 38 | +@JsonIgnoreProperties(ignoreUnknown = true) |
| 39 | +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2025-12-19T13:08:07.460137300-08:00[America/Los_Angeles]") |
| 40 | +public class User { |
| 41 | + |
| 42 | + @JsonProperty("user-name") |
| 43 | + private String userName = null; |
| 44 | + |
| 45 | + @JsonProperty("principal") |
| 46 | + private String principal = null; |
| 47 | + |
| 48 | + @JsonProperty("cac-auth") |
| 49 | + private Boolean cacAuth = null; |
| 50 | + |
| 51 | + @JsonProperty("email") |
| 52 | + private String email = null; |
| 53 | + |
| 54 | + @JsonProperty("roles") |
| 55 | + @Valid |
| 56 | + private Map<String, List<String>> roles = new HashMap<>(); |
| 57 | + |
| 58 | + public User userName(String userName) { |
| 59 | + this.userName = userName; |
| 60 | + return this; |
| 61 | + } |
| 62 | + |
| 63 | + public String getUserName() { |
| 64 | + return userName; |
| 65 | + } |
| 66 | + |
| 67 | + public void setUserName(String userName) { |
| 68 | + this.userName = userName; |
| 69 | + } |
| 70 | + |
| 71 | + public User principal(String principal) { |
| 72 | + this.principal = principal; |
| 73 | + return this; |
| 74 | + } |
| 75 | + |
| 76 | + public String getPrincipal() { |
| 77 | + return principal; |
| 78 | + } |
| 79 | + |
| 80 | + public void setPrincipal(String principal) { |
| 81 | + this.principal = principal; |
| 82 | + } |
| 83 | + |
| 84 | + public User cacAuth(Boolean cacAuth) { |
| 85 | + this.cacAuth = cacAuth; |
| 86 | + return this; |
| 87 | + } |
| 88 | + |
| 89 | + public Boolean isCacAuth() { |
| 90 | + return cacAuth; |
| 91 | + } |
| 92 | + |
| 93 | + public void setCacAuth(Boolean cacAuth) { |
| 94 | + this.cacAuth = cacAuth; |
| 95 | + } |
| 96 | + |
| 97 | + public User email(String email) { |
| 98 | + this.email = email; |
| 99 | + return this; |
| 100 | + } |
| 101 | + |
| 102 | + public String getEmail() { |
| 103 | + return email; |
| 104 | + } |
| 105 | + |
| 106 | + public void setEmail(String email) { |
| 107 | + this.email = email; |
| 108 | + } |
| 109 | + |
| 110 | + public User roles(Map<String, List<String>> roles) { |
| 111 | + this.roles = roles; |
| 112 | + return this; |
| 113 | + } |
| 114 | + |
| 115 | + public User putRolesItem(String key, List<String> rolesItem) { |
| 116 | + if (this.roles == null) { |
| 117 | + this.roles = new HashMap<>(); |
| 118 | + } |
| 119 | + this.roles.put(key, rolesItem); |
| 120 | + return this; |
| 121 | + } |
| 122 | + |
| 123 | + public Map<String, List<String>> getRoles() { |
| 124 | + return roles; |
| 125 | + } |
| 126 | + |
| 127 | + public void setRoles(Map<String, List<String>> roles) { |
| 128 | + this.roles = roles; |
| 129 | + } |
| 130 | + |
| 131 | + @Override |
| 132 | + public boolean equals(Object o) { |
| 133 | + if (this == o) { |
| 134 | + return true; |
| 135 | + } |
| 136 | + if (o == null || getClass() != o.getClass()) { |
| 137 | + return false; |
| 138 | + } |
| 139 | + User user = (User) o; |
| 140 | + return this.userName == null || user.userName == null?Objects.equals(this.userName, user.userName):this.userName.equalsIgnoreCase(user.userName) |
| 141 | + && this.principal == null || user.principal == null?Objects.equals(this.principal, user.principal):this.principal.equalsIgnoreCase(user.principal) |
| 142 | + && Objects.equals(this.cacAuth, user.cacAuth) |
| 143 | + && this.email == null || user.email == null?Objects.equals(this.email, user.email):this.email.equalsIgnoreCase(user.email) |
| 144 | + && Objects.equals(this.roles, user.roles) |
| 145 | + ; |
| 146 | + } |
| 147 | + |
| 148 | + @Override |
| 149 | + public int hashCode() { |
| 150 | + return Objects.hash(userName==null?0:userName.toLowerCase(), principal==null?0:principal.toLowerCase(), cacAuth, email==null?0:email.toLowerCase(), roles); |
| 151 | + } |
| 152 | + |
| 153 | + @Override |
| 154 | + public String toString() { |
| 155 | + StringBuilder sb = new StringBuilder(); |
| 156 | + sb.append("class User {\n"); |
| 157 | + |
| 158 | + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); |
| 159 | + sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); |
| 160 | + sb.append(" cacAuth: ").append(toIndentedString(cacAuth)).append("\n"); |
| 161 | + sb.append(" email: ").append(toIndentedString(email)).append("\n"); |
| 162 | + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); |
| 163 | + sb.append("}"); |
| 164 | + return sb.toString(); |
| 165 | + } |
| 166 | + |
| 167 | + /** |
| 168 | + * Convert the given object to string with each line indented by 4 spaces |
| 169 | + * (except the first line). |
| 170 | + */ |
| 171 | + private String toIndentedString(Object o) { |
| 172 | + if (o == null) { |
| 173 | + return "null"; |
| 174 | + } |
| 175 | + return o.toString().replace("\n", "\n "); |
| 176 | + } |
| 177 | +} |
0 commit comments