software.amazon.awssdk.services.ec2.model.VerifiedAccessLogs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ec2 Show documentation
Show all versions of ec2 Show documentation
The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with
Amazon EC2 Service
The newest version!
/*
* 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.ec2.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* Describes the options for Verified Access logs.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VerifiedAccessLogs implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField S3_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("S3")
.getter(getter(VerifiedAccessLogs::s3))
.setter(setter(Builder::s3))
.constructor(VerifiedAccessLogS3Destination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3").unmarshallLocationName("s3")
.build()).build();
private static final SdkField CLOUD_WATCH_LOGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("CloudWatchLogs")
.getter(getter(VerifiedAccessLogs::cloudWatchLogs))
.setter(setter(Builder::cloudWatchLogs))
.constructor(VerifiedAccessLogCloudWatchLogsDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLogs")
.unmarshallLocationName("cloudWatchLogs").build()).build();
private static final SdkField KINESIS_DATA_FIREHOSE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("KinesisDataFirehose")
.getter(getter(VerifiedAccessLogs::kinesisDataFirehose))
.setter(setter(Builder::kinesisDataFirehose))
.constructor(VerifiedAccessLogKinesisDataFirehoseDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KinesisDataFirehose")
.unmarshallLocationName("kinesisDataFirehose").build()).build();
private static final SdkField LOG_VERSION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("LogVersion")
.getter(getter(VerifiedAccessLogs::logVersion))
.setter(setter(Builder::logVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogVersion")
.unmarshallLocationName("logVersion").build()).build();
private static final SdkField INCLUDE_TRUST_CONTEXT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("IncludeTrustContext")
.getter(getter(VerifiedAccessLogs::includeTrustContext))
.setter(setter(Builder::includeTrustContext))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncludeTrustContext")
.unmarshallLocationName("includeTrustContext").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(S3_FIELD,
CLOUD_WATCH_LOGS_FIELD, KINESIS_DATA_FIREHOSE_FIELD, LOG_VERSION_FIELD, INCLUDE_TRUST_CONTEXT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("S3", S3_FIELD);
put("CloudWatchLogs", CLOUD_WATCH_LOGS_FIELD);
put("KinesisDataFirehose", KINESIS_DATA_FIREHOSE_FIELD);
put("LogVersion", LOG_VERSION_FIELD);
put("IncludeTrustContext", INCLUDE_TRUST_CONTEXT_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final VerifiedAccessLogS3Destination s3;
private final VerifiedAccessLogCloudWatchLogsDestination cloudWatchLogs;
private final VerifiedAccessLogKinesisDataFirehoseDestination kinesisDataFirehose;
private final String logVersion;
private final Boolean includeTrustContext;
private VerifiedAccessLogs(BuilderImpl builder) {
this.s3 = builder.s3;
this.cloudWatchLogs = builder.cloudWatchLogs;
this.kinesisDataFirehose = builder.kinesisDataFirehose;
this.logVersion = builder.logVersion;
this.includeTrustContext = builder.includeTrustContext;
}
/**
*
* Amazon S3 logging options.
*
*
* @return Amazon S3 logging options.
*/
public final VerifiedAccessLogS3Destination s3() {
return s3;
}
/**
*
* CloudWatch Logs logging destination.
*
*
* @return CloudWatch Logs logging destination.
*/
public final VerifiedAccessLogCloudWatchLogsDestination cloudWatchLogs() {
return cloudWatchLogs;
}
/**
*
* Kinesis logging destination.
*
*
* @return Kinesis logging destination.
*/
public final VerifiedAccessLogKinesisDataFirehoseDestination kinesisDataFirehose() {
return kinesisDataFirehose;
}
/**
*
* The log version.
*
*
* @return The log version.
*/
public final String logVersion() {
return logVersion;
}
/**
*
* Indicates whether trust data is included in the logs.
*
*
* @return Indicates whether trust data is included in the logs.
*/
public final Boolean includeTrustContext() {
return includeTrustContext;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(s3());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLogs());
hashCode = 31 * hashCode + Objects.hashCode(kinesisDataFirehose());
hashCode = 31 * hashCode + Objects.hashCode(logVersion());
hashCode = 31 * hashCode + Objects.hashCode(includeTrustContext());
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 VerifiedAccessLogs)) {
return false;
}
VerifiedAccessLogs other = (VerifiedAccessLogs) obj;
return Objects.equals(s3(), other.s3()) && Objects.equals(cloudWatchLogs(), other.cloudWatchLogs())
&& Objects.equals(kinesisDataFirehose(), other.kinesisDataFirehose())
&& Objects.equals(logVersion(), other.logVersion())
&& Objects.equals(includeTrustContext(), other.includeTrustContext());
}
/**
* 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("VerifiedAccessLogs").add("S3", s3()).add("CloudWatchLogs", cloudWatchLogs())
.add("KinesisDataFirehose", kinesisDataFirehose()).add("LogVersion", logVersion())
.add("IncludeTrustContext", includeTrustContext()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "S3":
return Optional.ofNullable(clazz.cast(s3()));
case "CloudWatchLogs":
return Optional.ofNullable(clazz.cast(cloudWatchLogs()));
case "KinesisDataFirehose":
return Optional.ofNullable(clazz.cast(kinesisDataFirehose()));
case "LogVersion":
return Optional.ofNullable(clazz.cast(logVersion()));
case "IncludeTrustContext":
return Optional.ofNullable(clazz.cast(includeTrustContext()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy