software.amazon.awssdk.services.cloudfront.model.FieldLevelEncryptionConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudfront Show documentation
Show all versions of cloudfront Show documentation
The AWS Java SDK for Amazon CloudFront module holds the client classes that are used for communicating
with Amazon CloudFront Service
/*
* 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.cloudfront.model;
import java.io.Serializable;
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.Consumer;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A complex data type that includes the profile configurations specified for field-level encryption.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class FieldLevelEncryptionConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CALLER_REFERENCE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CallerReference")
.getter(getter(FieldLevelEncryptionConfig::callerReference))
.setter(setter(Builder::callerReference))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CallerReference")
.unmarshallLocationName("CallerReference").build()).build();
private static final SdkField COMMENT_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Comment")
.getter(getter(FieldLevelEncryptionConfig::comment))
.setter(setter(Builder::comment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Comment")
.unmarshallLocationName("Comment").build()).build();
private static final SdkField QUERY_ARG_PROFILE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("QueryArgProfileConfig")
.getter(getter(FieldLevelEncryptionConfig::queryArgProfileConfig))
.setter(setter(Builder::queryArgProfileConfig))
.constructor(QueryArgProfileConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QueryArgProfileConfig")
.unmarshallLocationName("QueryArgProfileConfig").build()).build();
private static final SdkField CONTENT_TYPE_PROFILE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ContentTypeProfileConfig")
.getter(getter(FieldLevelEncryptionConfig::contentTypeProfileConfig))
.setter(setter(Builder::contentTypeProfileConfig))
.constructor(ContentTypeProfileConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContentTypeProfileConfig")
.unmarshallLocationName("ContentTypeProfileConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CALLER_REFERENCE_FIELD,
COMMENT_FIELD, QUERY_ARG_PROFILE_CONFIG_FIELD, CONTENT_TYPE_PROFILE_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String callerReference;
private final String comment;
private final QueryArgProfileConfig queryArgProfileConfig;
private final ContentTypeProfileConfig contentTypeProfileConfig;
private FieldLevelEncryptionConfig(BuilderImpl builder) {
this.callerReference = builder.callerReference;
this.comment = builder.comment;
this.queryArgProfileConfig = builder.queryArgProfileConfig;
this.contentTypeProfileConfig = builder.contentTypeProfileConfig;
}
/**
*
* A unique number that ensures the request can't be replayed.
*
*
* @return A unique number that ensures the request can't be replayed.
*/
public final String callerReference() {
return callerReference;
}
/**
*
* An optional comment about the configuration. The comment cannot be longer than 128 characters.
*
*
* @return An optional comment about the configuration. The comment cannot be longer than 128 characters.
*/
public final String comment() {
return comment;
}
/**
*
* A complex data type that specifies when to forward content if a profile isn't found and the profile that can be
* provided as a query argument in a request.
*
*
* @return A complex data type that specifies when to forward content if a profile isn't found and the profile that
* can be provided as a query argument in a request.
*/
public final QueryArgProfileConfig queryArgProfileConfig() {
return queryArgProfileConfig;
}
/**
*
* A complex data type that specifies when to forward content if a content type isn't recognized and profiles to use
* as by default in a request if a query argument doesn't specify a profile to use.
*
*
* @return A complex data type that specifies when to forward content if a content type isn't recognized and
* profiles to use as by default in a request if a query argument doesn't specify a profile to use.
*/
public final ContentTypeProfileConfig contentTypeProfileConfig() {
return contentTypeProfileConfig;
}
@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 + Objects.hashCode(callerReference());
hashCode = 31 * hashCode + Objects.hashCode(comment());
hashCode = 31 * hashCode + Objects.hashCode(queryArgProfileConfig());
hashCode = 31 * hashCode + Objects.hashCode(contentTypeProfileConfig());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof FieldLevelEncryptionConfig)) {
return false;
}
FieldLevelEncryptionConfig other = (FieldLevelEncryptionConfig) obj;
return Objects.equals(callerReference(), other.callerReference()) && Objects.equals(comment(), other.comment())
&& Objects.equals(queryArgProfileConfig(), other.queryArgProfileConfig())
&& Objects.equals(contentTypeProfileConfig(), other.contentTypeProfileConfig());
}
/**
* 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("FieldLevelEncryptionConfig").add("CallerReference", callerReference()).add("Comment", comment())
.add("QueryArgProfileConfig", queryArgProfileConfig())
.add("ContentTypeProfileConfig", contentTypeProfileConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CallerReference":
return Optional.ofNullable(clazz.cast(callerReference()));
case "Comment":
return Optional.ofNullable(clazz.cast(comment()));
case "QueryArgProfileConfig":
return Optional.ofNullable(clazz.cast(queryArgProfileConfig()));
case "ContentTypeProfileConfig":
return Optional.ofNullable(clazz.cast(contentTypeProfileConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function