software.amazon.awssdk.services.b2bi.model.UpdateProfileResponse Maven / Gradle / Ivy
Show all versions of b2bi Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.b2bi.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateProfileResponse extends B2BiResponse implements
ToCopyableBuilder {
private static final SdkField PROFILE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("profileId").getter(getter(UpdateProfileResponse::profileId)).setter(setter(Builder::profileId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("profileId").build()).build();
private static final SdkField PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("profileArn").getter(getter(UpdateProfileResponse::profileArn)).setter(setter(Builder::profileArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("profileArn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(UpdateProfileResponse::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField EMAIL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("email")
.getter(getter(UpdateProfileResponse::email)).setter(setter(Builder::email))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("email").build()).build();
private static final SdkField PHONE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("phone")
.getter(getter(UpdateProfileResponse::phone)).setter(setter(Builder::phone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("phone").build()).build();
private static final SdkField BUSINESS_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("businessName").getter(getter(UpdateProfileResponse::businessName)).setter(setter(Builder::businessName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("businessName").build()).build();
private static final SdkField LOGGING_FIELD = SdkField. builder(MarshallingType.STRING).memberName("logging")
.getter(getter(UpdateProfileResponse::loggingAsString)).setter(setter(Builder::logging))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logging").build()).build();
private static final SdkField LOG_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("logGroupName").getter(getter(UpdateProfileResponse::logGroupName)).setter(setter(Builder::logGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logGroupName").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("createdAt")
.getter(getter(UpdateProfileResponse::createdAt))
.setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField MODIFIED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("modifiedAt")
.getter(getter(UpdateProfileResponse::modifiedAt))
.setter(setter(Builder::modifiedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modifiedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROFILE_ID_FIELD,
PROFILE_ARN_FIELD, NAME_FIELD, EMAIL_FIELD, PHONE_FIELD, BUSINESS_NAME_FIELD, LOGGING_FIELD, LOG_GROUP_NAME_FIELD,
CREATED_AT_FIELD, MODIFIED_AT_FIELD));
private final String profileId;
private final String profileArn;
private final String name;
private final String email;
private final String phone;
private final String businessName;
private final String logging;
private final String logGroupName;
private final Instant createdAt;
private final Instant modifiedAt;
private UpdateProfileResponse(BuilderImpl builder) {
super(builder);
this.profileId = builder.profileId;
this.profileArn = builder.profileArn;
this.name = builder.name;
this.email = builder.email;
this.phone = builder.phone;
this.businessName = builder.businessName;
this.logging = builder.logging;
this.logGroupName = builder.logGroupName;
this.createdAt = builder.createdAt;
this.modifiedAt = builder.modifiedAt;
}
/**
*
* Returns the unique, system-generated identifier for the profile.
*
*
* @return Returns the unique, system-generated identifier for the profile.
*/
public final String profileId() {
return profileId;
}
/**
*
* Returns an Amazon Resource Name (ARN) for the profile.
*
*
* @return Returns an Amazon Resource Name (ARN) for the profile.
*/
public final String profileArn() {
return profileArn;
}
/**
*
* Returns the name of the profile.
*
*
* @return Returns the name of the profile.
*/
public final String name() {
return name;
}
/**
*
* Returns the email address associated with this customer profile.
*
*
* @return Returns the email address associated with this customer profile.
*/
public final String email() {
return email;
}
/**
*
* Returns the phone number associated with the profile.
*
*
* @return Returns the phone number associated with the profile.
*/
public final String phone() {
return phone;
}
/**
*
* Returns the name for the business associated with this profile.
*
*
* @return Returns the name for the business associated with this profile.
*/
public final String businessName() {
return businessName;
}
/**
*
* Specifies whether or not logging is enabled for this profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #logging} will
* return {@link Logging#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #loggingAsString}.
*
*
* @return Specifies whether or not logging is enabled for this profile.
* @see Logging
*/
public final Logging logging() {
return Logging.fromValue(logging);
}
/**
*
* Specifies whether or not logging is enabled for this profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #logging} will
* return {@link Logging#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #loggingAsString}.
*
*
* @return Specifies whether or not logging is enabled for this profile.
* @see Logging
*/
public final String loggingAsString() {
return logging;
}
/**
*
* Returns the name of the logging group.
*
*
* @return Returns the name of the logging group.
*/
public final String logGroupName() {
return logGroupName;
}
/**
*
* Returns a timestamp for creation date and time of the profile.
*
*
* @return Returns a timestamp for creation date and time of the profile.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* Returns a timestamp for last time the profile was modified.
*
*
* @return Returns a timestamp for last time the profile was modified.
*/
public final Instant modifiedAt() {
return modifiedAt;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(profileId());
hashCode = 31 * hashCode + Objects.hashCode(profileArn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(email());
hashCode = 31 * hashCode + Objects.hashCode(phone());
hashCode = 31 * hashCode + Objects.hashCode(businessName());
hashCode = 31 * hashCode + Objects.hashCode(loggingAsString());
hashCode = 31 * hashCode + Objects.hashCode(logGroupName());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(modifiedAt());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateProfileResponse)) {
return false;
}
UpdateProfileResponse other = (UpdateProfileResponse) obj;
return Objects.equals(profileId(), other.profileId()) && Objects.equals(profileArn(), other.profileArn())
&& Objects.equals(name(), other.name()) && Objects.equals(email(), other.email())
&& Objects.equals(phone(), other.phone()) && Objects.equals(businessName(), other.businessName())
&& Objects.equals(loggingAsString(), other.loggingAsString())
&& Objects.equals(logGroupName(), other.logGroupName()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(modifiedAt(), other.modifiedAt());
}
/**
* 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 final String toString() {
return ToString.builder("UpdateProfileResponse").add("ProfileId", profileId()).add("ProfileArn", profileArn())
.add("Name", name()).add("Email", email() == null ? null : "*** Sensitive Data Redacted ***")
.add("Phone", phone() == null ? null : "*** Sensitive Data Redacted ***").add("BusinessName", businessName())
.add("Logging", loggingAsString()).add("LogGroupName", logGroupName()).add("CreatedAt", createdAt())
.add("ModifiedAt", modifiedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "profileId":
return Optional.ofNullable(clazz.cast(profileId()));
case "profileArn":
return Optional.ofNullable(clazz.cast(profileArn()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "email":
return Optional.ofNullable(clazz.cast(email()));
case "phone":
return Optional.ofNullable(clazz.cast(phone()));
case "businessName":
return Optional.ofNullable(clazz.cast(businessName()));
case "logging":
return Optional.ofNullable(clazz.cast(loggingAsString()));
case "logGroupName":
return Optional.ofNullable(clazz.cast(logGroupName()));
case "createdAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "modifiedAt":
return Optional.ofNullable(clazz.cast(modifiedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function