software.amazon.awssdk.services.cleanrooms.model.CollaborationAnalysisTemplate Maven / Gradle / Ivy
Show all versions of cleanrooms 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.cleanrooms.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The analysis template within a collaboration.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CollaborationAnalysisTemplate implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id")
.getter(getter(CollaborationAnalysisTemplate::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(CollaborationAnalysisTemplate::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField COLLABORATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("collaborationId").getter(getter(CollaborationAnalysisTemplate::collaborationId))
.setter(setter(Builder::collaborationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("collaborationId").build()).build();
private static final SdkField COLLABORATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("collaborationArn").getter(getter(CollaborationAnalysisTemplate::collaborationArn))
.setter(setter(Builder::collaborationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("collaborationArn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(CollaborationAnalysisTemplate::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField CREATOR_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("creatorAccountId").getter(getter(CollaborationAnalysisTemplate::creatorAccountId))
.setter(setter(Builder::creatorAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creatorAccountId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(CollaborationAnalysisTemplate::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("createTime").getter(getter(CollaborationAnalysisTemplate::createTime))
.setter(setter(Builder::createTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createTime").build()).build();
private static final SdkField UPDATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("updateTime").getter(getter(CollaborationAnalysisTemplate::updateTime))
.setter(setter(Builder::updateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateTime").build()).build();
private static final SdkField SCHEMA_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("schema").getter(getter(CollaborationAnalysisTemplate::schema)).setter(setter(Builder::schema))
.constructor(AnalysisSchema::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schema").build()).build();
private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("format")
.getter(getter(CollaborationAnalysisTemplate::formatAsString)).setter(setter(Builder::format))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("format").build()).build();
private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("source").getter(getter(CollaborationAnalysisTemplate::source)).setter(setter(Builder::source))
.constructor(AnalysisSource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("source").build()).build();
private static final SdkField> ANALYSIS_PARAMETERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("analysisParameters")
.getter(getter(CollaborationAnalysisTemplate::analysisParameters))
.setter(setter(Builder::analysisParameters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("analysisParameters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AnalysisParameter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> VALIDATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("validations")
.getter(getter(CollaborationAnalysisTemplate::validations))
.setter(setter(Builder::validations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("validations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AnalysisTemplateValidationStatusDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, ARN_FIELD,
COLLABORATION_ID_FIELD, COLLABORATION_ARN_FIELD, DESCRIPTION_FIELD, CREATOR_ACCOUNT_ID_FIELD, NAME_FIELD,
CREATE_TIME_FIELD, UPDATE_TIME_FIELD, SCHEMA_FIELD, FORMAT_FIELD, SOURCE_FIELD, ANALYSIS_PARAMETERS_FIELD,
VALIDATIONS_FIELD));
private static final long serialVersionUID = 1L;
private final String id;
private final String arn;
private final String collaborationId;
private final String collaborationArn;
private final String description;
private final String creatorAccountId;
private final String name;
private final Instant createTime;
private final Instant updateTime;
private final AnalysisSchema schema;
private final String format;
private final AnalysisSource source;
private final List analysisParameters;
private final List validations;
private CollaborationAnalysisTemplate(BuilderImpl builder) {
this.id = builder.id;
this.arn = builder.arn;
this.collaborationId = builder.collaborationId;
this.collaborationArn = builder.collaborationArn;
this.description = builder.description;
this.creatorAccountId = builder.creatorAccountId;
this.name = builder.name;
this.createTime = builder.createTime;
this.updateTime = builder.updateTime;
this.schema = builder.schema;
this.format = builder.format;
this.source = builder.source;
this.analysisParameters = builder.analysisParameters;
this.validations = builder.validations;
}
/**
*
* The identifier of the analysis template.
*
*
* @return The identifier of the analysis template.
*/
public final String id() {
return id;
}
/**
*
* The Amazon Resource Name (ARN) of the analysis template.
*
*
* @return The Amazon Resource Name (ARN) of the analysis template.
*/
public final String arn() {
return arn;
}
/**
*
* A unique identifier for the collaboration that the analysis templates belong to. Currently accepts collaboration
* ID.
*
*
* @return A unique identifier for the collaboration that the analysis templates belong to. Currently accepts
* collaboration ID.
*/
public final String collaborationId() {
return collaborationId;
}
/**
*
* The unique ARN for the analysis template’s associated collaboration.
*
*
* @return The unique ARN for the analysis template’s associated collaboration.
*/
public final String collaborationArn() {
return collaborationArn;
}
/**
*
* The description of the analysis template.
*
*
* @return The description of the analysis template.
*/
public final String description() {
return description;
}
/**
*
* The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services
* account ID.
*
*
* @return The identifier used to reference members of the collaboration. Currently only supports Amazon Web
* Services account ID.
*/
public final String creatorAccountId() {
return creatorAccountId;
}
/**
*
* The name of the analysis template.
*
*
* @return The name of the analysis template.
*/
public final String name() {
return name;
}
/**
*
* The time that the analysis template within a collaboration was created.
*
*
* @return The time that the analysis template within a collaboration was created.
*/
public final Instant createTime() {
return createTime;
}
/**
*
* The time that the analysis template in the collaboration was last updated.
*
*
* @return The time that the analysis template in the collaboration was last updated.
*/
public final Instant updateTime() {
return updateTime;
}
/**
*
* The entire schema object.
*
*
* @return The entire schema object.
*/
public final AnalysisSchema schema() {
return schema;
}
/**
*
* The format of the analysis template in the collaboration.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #format} will
* return {@link AnalysisFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #formatAsString}.
*
*
* @return The format of the analysis template in the collaboration.
* @see AnalysisFormat
*/
public final AnalysisFormat format() {
return AnalysisFormat.fromValue(format);
}
/**
*
* The format of the analysis template in the collaboration.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #format} will
* return {@link AnalysisFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #formatAsString}.
*
*
* @return The format of the analysis template in the collaboration.
* @see AnalysisFormat
*/
public final String formatAsString() {
return format;
}
/**
*
* The source of the analysis template within a collaboration.
*
*
* @return The source of the analysis template within a collaboration.
*/
public final AnalysisSource source() {
return source;
}
/**
* For responses, this returns true if the service returned a value for the AnalysisParameters property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasAnalysisParameters() {
return analysisParameters != null && !(analysisParameters instanceof SdkAutoConstructList);
}
/**
*
* The analysis parameters that have been specified in the analysis template.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAnalysisParameters} method.
*
*
* @return The analysis parameters that have been specified in the analysis template.
*/
public final List analysisParameters() {
return analysisParameters;
}
/**
* For responses, this returns true if the service returned a value for the Validations property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasValidations() {
return validations != null && !(validations instanceof SdkAutoConstructList);
}
/**
*
* The validations that were performed.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasValidations} method.
*
*
* @return The validations that were performed.
*/
public final List validations() {
return validations;
}
@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(id());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(collaborationId());
hashCode = 31 * hashCode + Objects.hashCode(collaborationArn());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(creatorAccountId());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(createTime());
hashCode = 31 * hashCode + Objects.hashCode(updateTime());
hashCode = 31 * hashCode + Objects.hashCode(schema());
hashCode = 31 * hashCode + Objects.hashCode(formatAsString());
hashCode = 31 * hashCode + Objects.hashCode(source());
hashCode = 31 * hashCode + Objects.hashCode(hasAnalysisParameters() ? analysisParameters() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasValidations() ? validations() : null);
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 CollaborationAnalysisTemplate)) {
return false;
}
CollaborationAnalysisTemplate other = (CollaborationAnalysisTemplate) obj;
return Objects.equals(id(), other.id()) && Objects.equals(arn(), other.arn())
&& Objects.equals(collaborationId(), other.collaborationId())
&& Objects.equals(collaborationArn(), other.collaborationArn())
&& Objects.equals(description(), other.description())
&& Objects.equals(creatorAccountId(), other.creatorAccountId()) && Objects.equals(name(), other.name())
&& Objects.equals(createTime(), other.createTime()) && Objects.equals(updateTime(), other.updateTime())
&& Objects.equals(schema(), other.schema()) && Objects.equals(formatAsString(), other.formatAsString())
&& Objects.equals(source(), other.source()) && hasAnalysisParameters() == other.hasAnalysisParameters()
&& Objects.equals(analysisParameters(), other.analysisParameters()) && hasValidations() == other.hasValidations()
&& Objects.equals(validations(), other.validations());
}
/**
* 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("CollaborationAnalysisTemplate").add("Id", id()).add("Arn", arn())
.add("CollaborationId", collaborationId()).add("CollaborationArn", collaborationArn())
.add("Description", description()).add("CreatorAccountId", creatorAccountId()).add("Name", name())
.add("CreateTime", createTime()).add("UpdateTime", updateTime()).add("Schema", schema())
.add("Format", formatAsString()).add("Source", source() == null ? null : "*** Sensitive Data Redacted ***")
.add("AnalysisParameters", analysisParameters() == null ? null : "*** Sensitive Data Redacted ***")
.add("Validations", hasValidations() ? validations() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "id":
return Optional.ofNullable(clazz.cast(id()));
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "collaborationId":
return Optional.ofNullable(clazz.cast(collaborationId()));
case "collaborationArn":
return Optional.ofNullable(clazz.cast(collaborationArn()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "creatorAccountId":
return Optional.ofNullable(clazz.cast(creatorAccountId()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "createTime":
return Optional.ofNullable(clazz.cast(createTime()));
case "updateTime":
return Optional.ofNullable(clazz.cast(updateTime()));
case "schema":
return Optional.ofNullable(clazz.cast(schema()));
case "format":
return Optional.ofNullable(clazz.cast(formatAsString()));
case "source":
return Optional.ofNullable(clazz.cast(source()));
case "analysisParameters":
return Optional.ofNullable(clazz.cast(analysisParameters()));
case "validations":
return Optional.ofNullable(clazz.cast(validations()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function