software.amazon.awssdk.services.lookoutvision.model.ListDatasetEntriesRequest Maven / Gradle / Ivy
Show all versions of lookoutvision 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.lookoutvision.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.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 ListDatasetEntriesRequest extends LookoutVisionRequest implements
ToCopyableBuilder {
private static final SdkField PROJECT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectName").getter(getter(ListDatasetEntriesRequest::projectName))
.setter(setter(Builder::projectName))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("projectName").build()).build();
private static final SdkField DATASET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatasetType").getter(getter(ListDatasetEntriesRequest::datasetType))
.setter(setter(Builder::datasetType))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("datasetType").build()).build();
private static final SdkField LABELED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("Labeled").getter(getter(ListDatasetEntriesRequest::labeled)).setter(setter(Builder::labeled))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("labeled").build()).build();
private static final SdkField ANOMALY_CLASS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AnomalyClass").getter(getter(ListDatasetEntriesRequest::anomalyClass))
.setter(setter(Builder::anomalyClass))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("anomalyClass").build()).build();
private static final SdkField BEFORE_CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("BeforeCreationDate").getter(getter(ListDatasetEntriesRequest::beforeCreationDate))
.setter(setter(Builder::beforeCreationDate))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("createdBefore").build()).build();
private static final SdkField AFTER_CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("AfterCreationDate").getter(getter(ListDatasetEntriesRequest::afterCreationDate))
.setter(setter(Builder::afterCreationDate))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("createdAfter").build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(ListDatasetEntriesRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("nextToken").build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxResults").getter(getter(ListDatasetEntriesRequest::maxResults)).setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("maxResults").build()).build();
private static final SdkField SOURCE_REF_CONTAINS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceRefContains").getter(getter(ListDatasetEntriesRequest::sourceRefContains))
.setter(setter(Builder::sourceRefContains))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("sourceRefContains").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROJECT_NAME_FIELD,
DATASET_TYPE_FIELD, LABELED_FIELD, ANOMALY_CLASS_FIELD, BEFORE_CREATION_DATE_FIELD, AFTER_CREATION_DATE_FIELD,
NEXT_TOKEN_FIELD, MAX_RESULTS_FIELD, SOURCE_REF_CONTAINS_FIELD));
private final String projectName;
private final String datasetType;
private final Boolean labeled;
private final String anomalyClass;
private final Instant beforeCreationDate;
private final Instant afterCreationDate;
private final String nextToken;
private final Integer maxResults;
private final String sourceRefContains;
private ListDatasetEntriesRequest(BuilderImpl builder) {
super(builder);
this.projectName = builder.projectName;
this.datasetType = builder.datasetType;
this.labeled = builder.labeled;
this.anomalyClass = builder.anomalyClass;
this.beforeCreationDate = builder.beforeCreationDate;
this.afterCreationDate = builder.afterCreationDate;
this.nextToken = builder.nextToken;
this.maxResults = builder.maxResults;
this.sourceRefContains = builder.sourceRefContains;
}
/**
*
* The name of the project that contains the dataset that you want to list.
*
*
* @return The name of the project that contains the dataset that you want to list.
*/
public final String projectName() {
return projectName;
}
/**
*
* The type of the dataset that you want to list. Specify train
to list the training dataset. Specify
* test
to list the test dataset. If you have a single dataset project, specify train
.
*
*
* @return The type of the dataset that you want to list. Specify train
to list the training dataset.
* Specify test
to list the test dataset. If you have a single dataset project, specify
* train
.
*/
public final String datasetType() {
return datasetType;
}
/**
*
* Specify true
to include labeled entries, otherwise specify false
. If you don't specify
* a value, Lookout for Vision returns all entries.
*
*
* @return Specify true
to include labeled entries, otherwise specify false
. If you don't
* specify a value, Lookout for Vision returns all entries.
*/
public final Boolean labeled() {
return labeled;
}
/**
*
* Specify normal
to include only normal images. Specify anomaly
to only include anomalous
* entries. If you don't specify a value, Amazon Lookout for Vision returns normal and anomalous images.
*
*
* @return Specify normal
to include only normal images. Specify anomaly
to only include
* anomalous entries. If you don't specify a value, Amazon Lookout for Vision returns normal and anomalous
* images.
*/
public final String anomalyClass() {
return anomalyClass;
}
/**
*
* Only includes entries before the specified date in the response. For example, 2020-06-23T00:00:00
.
*
*
* @return Only includes entries before the specified date in the response. For example,
* 2020-06-23T00:00:00
.
*/
public final Instant beforeCreationDate() {
return beforeCreationDate;
}
/**
*
* Only includes entries after the specified date in the response. For example, 2020-06-23T00:00:00
.
*
*
* @return Only includes entries after the specified date in the response. For example,
* 2020-06-23T00:00:00
.
*/
public final Instant afterCreationDate() {
return afterCreationDate;
}
/**
*
* If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for Vision
* returns a pagination token in the response. You can use this pagination token to retrieve the next set of dataset
* entries.
*
*
* @return If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for
* Vision returns a pagination token in the response. You can use this pagination token to retrieve the next
* set of dataset entries.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The maximum number of results to return per paginated call. The largest value you can specify is 100. If you
* specify a value greater than 100, a ValidationException error occurs. The default value is 100.
*
*
* @return The maximum number of results to return per paginated call. The largest value you can specify is 100. If
* you specify a value greater than 100, a ValidationException error occurs. The default value is 100.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* Perform a "contains" search on the values of the source-ref
key within the dataset. For example a
* value of "IMG_17" returns all JSON Lines where the source-ref
key value matches *IMG_17*.
*
*
* @return Perform a "contains" search on the values of the source-ref
key within the dataset. For
* example a value of "IMG_17" returns all JSON Lines where the source-ref
key value matches
* *IMG_17*.
*/
public final String sourceRefContains() {
return sourceRefContains;
}
@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(projectName());
hashCode = 31 * hashCode + Objects.hashCode(datasetType());
hashCode = 31 * hashCode + Objects.hashCode(labeled());
hashCode = 31 * hashCode + Objects.hashCode(anomalyClass());
hashCode = 31 * hashCode + Objects.hashCode(beforeCreationDate());
hashCode = 31 * hashCode + Objects.hashCode(afterCreationDate());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(sourceRefContains());
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 ListDatasetEntriesRequest)) {
return false;
}
ListDatasetEntriesRequest other = (ListDatasetEntriesRequest) obj;
return Objects.equals(projectName(), other.projectName()) && Objects.equals(datasetType(), other.datasetType())
&& Objects.equals(labeled(), other.labeled()) && Objects.equals(anomalyClass(), other.anomalyClass())
&& Objects.equals(beforeCreationDate(), other.beforeCreationDate())
&& Objects.equals(afterCreationDate(), other.afterCreationDate())
&& Objects.equals(nextToken(), other.nextToken()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(sourceRefContains(), other.sourceRefContains());
}
/**
* 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("ListDatasetEntriesRequest").add("ProjectName", projectName()).add("DatasetType", datasetType())
.add("Labeled", labeled()).add("AnomalyClass", anomalyClass()).add("BeforeCreationDate", beforeCreationDate())
.add("AfterCreationDate", afterCreationDate()).add("NextToken", nextToken()).add("MaxResults", maxResults())
.add("SourceRefContains", sourceRefContains()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ProjectName":
return Optional.ofNullable(clazz.cast(projectName()));
case "DatasetType":
return Optional.ofNullable(clazz.cast(datasetType()));
case "Labeled":
return Optional.ofNullable(clazz.cast(labeled()));
case "AnomalyClass":
return Optional.ofNullable(clazz.cast(anomalyClass()));
case "BeforeCreationDate":
return Optional.ofNullable(clazz.cast(beforeCreationDate()));
case "AfterCreationDate":
return Optional.ofNullable(clazz.cast(afterCreationDate()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "MaxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "SourceRefContains":
return Optional.ofNullable(clazz.cast(sourceRefContains()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function