@Override public UserType build() { return new UserType(this); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(attributes()); hashCode = 31 * hashCode + Objects.hashCode(userCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(userLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(userStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(mfaOptions()); return hashCode; }
public final UserType.Builder getUser() { return user != null ? user.toBuilder() : null; }
@Override @SafeVarargs public final Builder users(Consumer<UserType.Builder>... users) { users(Stream.of(users).map(c -> UserType.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
@Override @SafeVarargs public final Builder users(Consumer<UserType.Builder>... users) { users(Stream.of(users).map(c -> UserType.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("UserType").add("Username", username() == null ? null : "*** Sensitive Data Redacted ***") .add("Attributes", attributes()).add("UserCreateDate", userCreateDate()) .add("UserLastModifiedDate", userLastModifiedDate()).add("Enabled", enabled()) .add("UserStatus", userStatusAsString()).add("MFAOptions", mfaOptions()).build(); }
@Override @SafeVarargs public final Builder users(Consumer<UserType.Builder>... users) { users(Stream.of(users).map(c -> UserType.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
@Override public UserType build() { return new UserType(this); } }
public final UserType.Builder getUser() { return user != null ? user.toBuilder() : null; }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(attributes()); hashCode = 31 * hashCode + Objects.hashCode(userCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(userLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(userStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(mfaOptions()); return hashCode; }
@Override @SafeVarargs public final Builder users(Consumer<UserType.Builder>... users) { users(Stream.of(users).map(c -> UserType.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
@Override public String toString() { return ToString.builder("UserType").add("Username", username()).add("Attributes", attributes()) .add("UserCreateDate", userCreateDate()).add("UserLastModifiedDate", userLastModifiedDate()) .add("Enabled", enabled()).add("UserStatus", userStatusAsString()).add("MFAOptions", mfaOptions()).build(); }
/** * <p> * The newly created user. * </p> * This is a convenience that creates an instance of the {@link UserType.Builder} avoiding the need to create * one manually via {@link UserType#builder()}. * * When the {@link Consumer} completes, {@link UserType.Builder#build()} is called immediately and its result is * passed to {@link #user(UserType)}. * * @param user * a consumer that will call methods on {@link UserType.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #user(UserType) */ default Builder user(Consumer<UserType.Builder> user) { return user(UserType.builder().applyMutation(user).build()); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UserType)) { return false; } UserType other = (UserType) obj; return Objects.equals(username(), other.username()) && Objects.equals(attributes(), other.attributes()) && Objects.equals(userCreateDate(), other.userCreateDate()) && Objects.equals(userLastModifiedDate(), other.userLastModifiedDate()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(userStatusAsString(), other.userStatusAsString()) && Objects.equals(mfaOptions(), other.mfaOptions()); }
/** * <p> * The newly created user. * </p> * This is a convenience that creates an instance of the {@link UserType.Builder} avoiding the need to create * one manually via {@link UserType#builder()}. * * When the {@link Consumer} completes, {@link UserType.Builder#build()} is called immediately and its result is * passed to {@link #user(UserType)}. * * @param user * a consumer that will call methods on {@link UserType.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #user(UserType) */ default Builder user(Consumer<UserType.Builder> user) { return user(UserType.builder().applyMutation(user).build()); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UserType)) { return false; } UserType other = (UserType) obj; return Objects.equals(username(), other.username()) && Objects.equals(attributes(), other.attributes()) && Objects.equals(userCreateDate(), other.userCreateDate()) && Objects.equals(userLastModifiedDate(), other.userLastModifiedDate()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(userStatusAsString(), other.userStatusAsString()) && Objects.equals(mfaOptions(), other.mfaOptions()); }
public UserType unmarshall(JsonUnmarshallerContext context) throws Exception { UserType.Builder userTypeBuilder = UserType.builder();
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Username": return Optional.ofNullable(clazz.cast(username())); case "Attributes": return Optional.ofNullable(clazz.cast(attributes())); case "UserCreateDate": return Optional.ofNullable(clazz.cast(userCreateDate())); case "UserLastModifiedDate": return Optional.ofNullable(clazz.cast(userLastModifiedDate())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "UserStatus": return Optional.ofNullable(clazz.cast(userStatusAsString())); case "MFAOptions": return Optional.ofNullable(clazz.cast(mfaOptions())); default: return Optional.empty(); } }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Username": return Optional.ofNullable(clazz.cast(username())); case "Attributes": return Optional.ofNullable(clazz.cast(attributes())); case "UserCreateDate": return Optional.ofNullable(clazz.cast(userCreateDate())); case "UserLastModifiedDate": return Optional.ofNullable(clazz.cast(userLastModifiedDate())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "UserStatus": return Optional.ofNullable(clazz.cast(userStatusAsString())); case "MFAOptions": return Optional.ofNullable(clazz.cast(mfaOptions())); default: return Optional.empty(); } }
/** * Marshall the given parameter object */ public void marshall(UserType userType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(userType, "userType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(userType.username(), USERNAME_BINDING); protocolMarshaller.marshall(userType.attributes(), ATTRIBUTES_BINDING); protocolMarshaller.marshall(userType.userCreateDate(), USERCREATEDATE_BINDING); protocolMarshaller.marshall(userType.userLastModifiedDate(), USERLASTMODIFIEDDATE_BINDING); protocolMarshaller.marshall(userType.enabled(), ENABLED_BINDING); protocolMarshaller.marshall(userType.userStatusAsString(), USERSTATUS_BINDING); protocolMarshaller.marshall(userType.mfaOptions(), MFAOPTIONS_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }