software.amazon.awssdk.services.bedrock.model.ListFoundationModelsRequest Maven / Gradle / Ivy
Show all versions of bedrock 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.bedrock.model;
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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ListFoundationModelsRequest extends BedrockRequest implements
ToCopyableBuilder {
private static final SdkField BY_PROVIDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("byProvider").getter(getter(ListFoundationModelsRequest::byProvider)).setter(setter(Builder::byProvider))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("byProvider").build()).build();
private static final SdkField BY_CUSTOMIZATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("byCustomizationType").getter(getter(ListFoundationModelsRequest::byCustomizationTypeAsString))
.setter(setter(Builder::byCustomizationType))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("byCustomizationType").build())
.build();
private static final SdkField BY_OUTPUT_MODALITY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("byOutputModality").getter(getter(ListFoundationModelsRequest::byOutputModalityAsString))
.setter(setter(Builder::byOutputModality))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("byOutputModality").build())
.build();
private static final SdkField BY_INFERENCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("byInferenceType").getter(getter(ListFoundationModelsRequest::byInferenceTypeAsString))
.setter(setter(Builder::byInferenceType))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("byInferenceType").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BY_PROVIDER_FIELD,
BY_CUSTOMIZATION_TYPE_FIELD, BY_OUTPUT_MODALITY_FIELD, BY_INFERENCE_TYPE_FIELD));
private final String byProvider;
private final String byCustomizationType;
private final String byOutputModality;
private final String byInferenceType;
private ListFoundationModelsRequest(BuilderImpl builder) {
super(builder);
this.byProvider = builder.byProvider;
this.byCustomizationType = builder.byCustomizationType;
this.byOutputModality = builder.byOutputModality;
this.byInferenceType = builder.byInferenceType;
}
/**
*
* Return models belonging to the model provider that you specify.
*
*
* @return Return models belonging to the model provider that you specify.
*/
public final String byProvider() {
return byProvider;
}
/**
*
* Return models that support the customization type that you specify. For more information, see Custom models in the Amazon Bedrock User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #byCustomizationType} will return {@link ModelCustomization#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #byCustomizationTypeAsString}.
*
*
* @return Return models that support the customization type that you specify. For more information, see Custom models in the
* Amazon Bedrock User
* Guide.
* @see ModelCustomization
*/
public final ModelCustomization byCustomizationType() {
return ModelCustomization.fromValue(byCustomizationType);
}
/**
*
* Return models that support the customization type that you specify. For more information, see Custom models in the Amazon Bedrock User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #byCustomizationType} will return {@link ModelCustomization#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #byCustomizationTypeAsString}.
*
*
* @return Return models that support the customization type that you specify. For more information, see Custom models in the
* Amazon Bedrock User
* Guide.
* @see ModelCustomization
*/
public final String byCustomizationTypeAsString() {
return byCustomizationType;
}
/**
*
* Return models that support the output modality that you specify.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #byOutputModality}
* will return {@link ModelModality#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #byOutputModalityAsString}.
*
*
* @return Return models that support the output modality that you specify.
* @see ModelModality
*/
public final ModelModality byOutputModality() {
return ModelModality.fromValue(byOutputModality);
}
/**
*
* Return models that support the output modality that you specify.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #byOutputModality}
* will return {@link ModelModality#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #byOutputModalityAsString}.
*
*
* @return Return models that support the output modality that you specify.
* @see ModelModality
*/
public final String byOutputModalityAsString() {
return byOutputModality;
}
/**
*
* Return models that support the inference type that you specify. For more information, see Provisioned Throughput in
* the Amazon Bedrock User
* Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #byInferenceType}
* will return {@link InferenceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #byInferenceTypeAsString}.
*
*
* @return Return models that support the inference type that you specify. For more information, see Provisioned
* Throughput in the Amazon Bedrock User
* Guide.
* @see InferenceType
*/
public final InferenceType byInferenceType() {
return InferenceType.fromValue(byInferenceType);
}
/**
*
* Return models that support the inference type that you specify. For more information, see Provisioned Throughput in
* the Amazon Bedrock User
* Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #byInferenceType}
* will return {@link InferenceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #byInferenceTypeAsString}.
*
*
* @return Return models that support the inference type that you specify. For more information, see Provisioned
* Throughput in the Amazon Bedrock User
* Guide.
* @see InferenceType
*/
public final String byInferenceTypeAsString() {
return byInferenceType;
}
@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(byProvider());
hashCode = 31 * hashCode + Objects.hashCode(byCustomizationTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(byOutputModalityAsString());
hashCode = 31 * hashCode + Objects.hashCode(byInferenceTypeAsString());
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 ListFoundationModelsRequest)) {
return false;
}
ListFoundationModelsRequest other = (ListFoundationModelsRequest) obj;
return Objects.equals(byProvider(), other.byProvider())
&& Objects.equals(byCustomizationTypeAsString(), other.byCustomizationTypeAsString())
&& Objects.equals(byOutputModalityAsString(), other.byOutputModalityAsString())
&& Objects.equals(byInferenceTypeAsString(), other.byInferenceTypeAsString());
}
/**
* 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("ListFoundationModelsRequest").add("ByProvider", byProvider())
.add("ByCustomizationType", byCustomizationTypeAsString()).add("ByOutputModality", byOutputModalityAsString())
.add("ByInferenceType", byInferenceTypeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "byProvider":
return Optional.ofNullable(clazz.cast(byProvider()));
case "byCustomizationType":
return Optional.ofNullable(clazz.cast(byCustomizationTypeAsString()));
case "byOutputModality":
return Optional.ofNullable(clazz.cast(byOutputModalityAsString()));
case "byInferenceType":
return Optional.ofNullable(clazz.cast(byInferenceTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function