software.amazon.awssdk.services.bedrock.model.GetImportedModelResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrock Show documentation
Show all versions of bedrock Show documentation
The AWS Java SDK for Bedrock module holds the client classes that are used for
communicating with Bedrock.
/*
* 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.bedrock.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.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.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 GetImportedModelResponse extends BedrockResponse implements
ToCopyableBuilder {
private static final SdkField MODEL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("modelArn").getter(getter(GetImportedModelResponse::modelArn)).setter(setter(Builder::modelArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelArn").build()).build();
private static final SdkField MODEL_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("modelName").getter(getter(GetImportedModelResponse::modelName)).setter(setter(Builder::modelName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelName").build()).build();
private static final SdkField JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("jobName").getter(getter(GetImportedModelResponse::jobName)).setter(setter(Builder::jobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobName").build()).build();
private static final SdkField JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("jobArn")
.getter(getter(GetImportedModelResponse::jobArn)).setter(setter(Builder::jobArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobArn").build()).build();
private static final SdkField MODEL_DATA_SOURCE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("modelDataSource")
.getter(getter(GetImportedModelResponse::modelDataSource)).setter(setter(Builder::modelDataSource))
.constructor(ModelDataSource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelDataSource").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("creationTime")
.getter(getter(GetImportedModelResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField MODEL_ARCHITECTURE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("modelArchitecture").getter(getter(GetImportedModelResponse::modelArchitecture))
.setter(setter(Builder::modelArchitecture))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelArchitecture").build()).build();
private static final SdkField MODEL_KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("modelKmsKeyArn").getter(getter(GetImportedModelResponse::modelKmsKeyArn))
.setter(setter(Builder::modelKmsKeyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelKmsKeyArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MODEL_ARN_FIELD,
MODEL_NAME_FIELD, JOB_NAME_FIELD, JOB_ARN_FIELD, MODEL_DATA_SOURCE_FIELD, CREATION_TIME_FIELD,
MODEL_ARCHITECTURE_FIELD, MODEL_KMS_KEY_ARN_FIELD));
private final String modelArn;
private final String modelName;
private final String jobName;
private final String jobArn;
private final ModelDataSource modelDataSource;
private final Instant creationTime;
private final String modelArchitecture;
private final String modelKmsKeyArn;
private GetImportedModelResponse(BuilderImpl builder) {
super(builder);
this.modelArn = builder.modelArn;
this.modelName = builder.modelName;
this.jobName = builder.jobName;
this.jobArn = builder.jobArn;
this.modelDataSource = builder.modelDataSource;
this.creationTime = builder.creationTime;
this.modelArchitecture = builder.modelArchitecture;
this.modelKmsKeyArn = builder.modelKmsKeyArn;
}
/**
*
* The Amazon Resource Name (ARN) associated with this imported model.
*
*
* @return The Amazon Resource Name (ARN) associated with this imported model.
*/
public final String modelArn() {
return modelArn;
}
/**
*
* The name of the imported model.
*
*
* @return The name of the imported model.
*/
public final String modelName() {
return modelName;
}
/**
*
* Job name associated with the imported model.
*
*
* @return Job name associated with the imported model.
*/
public final String jobName() {
return jobName;
}
/**
*
* Job Amazon Resource Name (ARN) associated with the imported model.
*
*
* @return Job Amazon Resource Name (ARN) associated with the imported model.
*/
public final String jobArn() {
return jobArn;
}
/**
*
* The data source for this imported model.
*
*
* @return The data source for this imported model.
*/
public final ModelDataSource modelDataSource() {
return modelDataSource;
}
/**
*
* Creation time of the imported model.
*
*
* @return Creation time of the imported model.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The architecture of the imported model.
*
*
* @return The architecture of the imported model.
*/
public final String modelArchitecture() {
return modelArchitecture;
}
/**
*
* The imported model is encrypted at rest using this key.
*
*
* @return The imported model is encrypted at rest using this key.
*/
public final String modelKmsKeyArn() {
return modelKmsKeyArn;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(modelArn());
hashCode = 31 * hashCode + Objects.hashCode(modelName());
hashCode = 31 * hashCode + Objects.hashCode(jobName());
hashCode = 31 * hashCode + Objects.hashCode(jobArn());
hashCode = 31 * hashCode + Objects.hashCode(modelDataSource());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(modelArchitecture());
hashCode = 31 * hashCode + Objects.hashCode(modelKmsKeyArn());
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 GetImportedModelResponse)) {
return false;
}
GetImportedModelResponse other = (GetImportedModelResponse) obj;
return Objects.equals(modelArn(), other.modelArn()) && Objects.equals(modelName(), other.modelName())
&& Objects.equals(jobName(), other.jobName()) && Objects.equals(jobArn(), other.jobArn())
&& Objects.equals(modelDataSource(), other.modelDataSource())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(modelArchitecture(), other.modelArchitecture())
&& Objects.equals(modelKmsKeyArn(), other.modelKmsKeyArn());
}
/**
* 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("GetImportedModelResponse").add("ModelArn", modelArn()).add("ModelName", modelName())
.add("JobName", jobName()).add("JobArn", jobArn()).add("ModelDataSource", modelDataSource())
.add("CreationTime", creationTime()).add("ModelArchitecture", modelArchitecture())
.add("ModelKmsKeyArn", modelKmsKeyArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "modelArn":
return Optional.ofNullable(clazz.cast(modelArn()));
case "modelName":
return Optional.ofNullable(clazz.cast(modelName()));
case "jobName":
return Optional.ofNullable(clazz.cast(jobName()));
case "jobArn":
return Optional.ofNullable(clazz.cast(jobArn()));
case "modelDataSource":
return Optional.ofNullable(clazz.cast(modelDataSource()));
case "creationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "modelArchitecture":
return Optional.ofNullable(clazz.cast(modelArchitecture()));
case "modelKmsKeyArn":
return Optional.ofNullable(clazz.cast(modelKmsKeyArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function