All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.fis.model.ExperimentLogConfiguration Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Fis module holds the client classes that are used for communicating with Fis.

There is a newer version: 2.29.39
Show 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.fis.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;

/**
 * 

* Describes the configuration for experiment logging. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ExperimentLogConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CLOUD_WATCH_LOGS_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("cloudWatchLogsConfiguration") .getter(getter(ExperimentLogConfiguration::cloudWatchLogsConfiguration)) .setter(setter(Builder::cloudWatchLogsConfiguration)) .constructor(ExperimentCloudWatchLogsLogConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cloudWatchLogsConfiguration") .build()).build(); private static final SdkField S3_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("s3Configuration") .getter(getter(ExperimentLogConfiguration::s3Configuration)).setter(setter(Builder::s3Configuration)) .constructor(ExperimentS3LogConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3Configuration").build()).build(); private static final SdkField LOG_SCHEMA_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("logSchemaVersion").getter(getter(ExperimentLogConfiguration::logSchemaVersion)) .setter(setter(Builder::logSchemaVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logSchemaVersion").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( CLOUD_WATCH_LOGS_CONFIGURATION_FIELD, S3_CONFIGURATION_FIELD, LOG_SCHEMA_VERSION_FIELD)); private static final long serialVersionUID = 1L; private final ExperimentCloudWatchLogsLogConfiguration cloudWatchLogsConfiguration; private final ExperimentS3LogConfiguration s3Configuration; private final Integer logSchemaVersion; private ExperimentLogConfiguration(BuilderImpl builder) { this.cloudWatchLogsConfiguration = builder.cloudWatchLogsConfiguration; this.s3Configuration = builder.s3Configuration; this.logSchemaVersion = builder.logSchemaVersion; } /** *

* The configuration for experiment logging to Amazon CloudWatch Logs. *

* * @return The configuration for experiment logging to Amazon CloudWatch Logs. */ public final ExperimentCloudWatchLogsLogConfiguration cloudWatchLogsConfiguration() { return cloudWatchLogsConfiguration; } /** *

* The configuration for experiment logging to Amazon S3. *

* * @return The configuration for experiment logging to Amazon S3. */ public final ExperimentS3LogConfiguration s3Configuration() { return s3Configuration; } /** *

* The schema version. *

* * @return The schema version. */ public final Integer logSchemaVersion() { return logSchemaVersion; } @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(cloudWatchLogsConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(s3Configuration()); hashCode = 31 * hashCode + Objects.hashCode(logSchemaVersion()); 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 ExperimentLogConfiguration)) { return false; } ExperimentLogConfiguration other = (ExperimentLogConfiguration) obj; return Objects.equals(cloudWatchLogsConfiguration(), other.cloudWatchLogsConfiguration()) && Objects.equals(s3Configuration(), other.s3Configuration()) && Objects.equals(logSchemaVersion(), other.logSchemaVersion()); } /** * 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("ExperimentLogConfiguration").add("CloudWatchLogsConfiguration", cloudWatchLogsConfiguration()) .add("S3Configuration", s3Configuration()).add("LogSchemaVersion", logSchemaVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "cloudWatchLogsConfiguration": return Optional.ofNullable(clazz.cast(cloudWatchLogsConfiguration())); case "s3Configuration": return Optional.ofNullable(clazz.cast(s3Configuration())); case "logSchemaVersion": return Optional.ofNullable(clazz.cast(logSchemaVersion())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ExperimentLogConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The configuration for experiment logging to Amazon CloudWatch Logs. *

* * @param cloudWatchLogsConfiguration * The configuration for experiment logging to Amazon CloudWatch Logs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cloudWatchLogsConfiguration(ExperimentCloudWatchLogsLogConfiguration cloudWatchLogsConfiguration); /** *

* The configuration for experiment logging to Amazon CloudWatch Logs. *

* This is a convenience method that creates an instance of the * {@link ExperimentCloudWatchLogsLogConfiguration.Builder} avoiding the need to create one manually via * {@link ExperimentCloudWatchLogsLogConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link ExperimentCloudWatchLogsLogConfiguration.Builder#build()} is * called immediately and its result is passed to * {@link #cloudWatchLogsConfiguration(ExperimentCloudWatchLogsLogConfiguration)}. * * @param cloudWatchLogsConfiguration * a consumer that will call methods on {@link ExperimentCloudWatchLogsLogConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #cloudWatchLogsConfiguration(ExperimentCloudWatchLogsLogConfiguration) */ default Builder cloudWatchLogsConfiguration( Consumer cloudWatchLogsConfiguration) { return cloudWatchLogsConfiguration(ExperimentCloudWatchLogsLogConfiguration.builder() .applyMutation(cloudWatchLogsConfiguration).build()); } /** *

* The configuration for experiment logging to Amazon S3. *

* * @param s3Configuration * The configuration for experiment logging to Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder s3Configuration(ExperimentS3LogConfiguration s3Configuration); /** *

* The configuration for experiment logging to Amazon S3. *

* This is a convenience method that creates an instance of the {@link ExperimentS3LogConfiguration.Builder} * avoiding the need to create one manually via {@link ExperimentS3LogConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link ExperimentS3LogConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #s3Configuration(ExperimentS3LogConfiguration)}. * * @param s3Configuration * a consumer that will call methods on {@link ExperimentS3LogConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #s3Configuration(ExperimentS3LogConfiguration) */ default Builder s3Configuration(Consumer s3Configuration) { return s3Configuration(ExperimentS3LogConfiguration.builder().applyMutation(s3Configuration).build()); } /** *

* The schema version. *

* * @param logSchemaVersion * The schema version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logSchemaVersion(Integer logSchemaVersion); } static final class BuilderImpl implements Builder { private ExperimentCloudWatchLogsLogConfiguration cloudWatchLogsConfiguration; private ExperimentS3LogConfiguration s3Configuration; private Integer logSchemaVersion; private BuilderImpl() { } private BuilderImpl(ExperimentLogConfiguration model) { cloudWatchLogsConfiguration(model.cloudWatchLogsConfiguration); s3Configuration(model.s3Configuration); logSchemaVersion(model.logSchemaVersion); } public final ExperimentCloudWatchLogsLogConfiguration.Builder getCloudWatchLogsConfiguration() { return cloudWatchLogsConfiguration != null ? cloudWatchLogsConfiguration.toBuilder() : null; } public final void setCloudWatchLogsConfiguration( ExperimentCloudWatchLogsLogConfiguration.BuilderImpl cloudWatchLogsConfiguration) { this.cloudWatchLogsConfiguration = cloudWatchLogsConfiguration != null ? cloudWatchLogsConfiguration.build() : null; } @Override public final Builder cloudWatchLogsConfiguration(ExperimentCloudWatchLogsLogConfiguration cloudWatchLogsConfiguration) { this.cloudWatchLogsConfiguration = cloudWatchLogsConfiguration; return this; } public final ExperimentS3LogConfiguration.Builder getS3Configuration() { return s3Configuration != null ? s3Configuration.toBuilder() : null; } public final void setS3Configuration(ExperimentS3LogConfiguration.BuilderImpl s3Configuration) { this.s3Configuration = s3Configuration != null ? s3Configuration.build() : null; } @Override public final Builder s3Configuration(ExperimentS3LogConfiguration s3Configuration) { this.s3Configuration = s3Configuration; return this; } public final Integer getLogSchemaVersion() { return logSchemaVersion; } public final void setLogSchemaVersion(Integer logSchemaVersion) { this.logSchemaVersion = logSchemaVersion; } @Override public final Builder logSchemaVersion(Integer logSchemaVersion) { this.logSchemaVersion = logSchemaVersion; return this; } @Override public ExperimentLogConfiguration build() { return new ExperimentLogConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy