
software.amazon.awssdk.services.machinelearning.model.DescribeDataSourcesRequest Maven / Gradle / Ivy
/*
* 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.machinelearning.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 DescribeDataSourcesRequest extends MachineLearningRequest implements
ToCopyableBuilder {
private static final SdkField FILTER_VARIABLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FilterVariable").getter(getter(DescribeDataSourcesRequest::filterVariableAsString))
.setter(setter(Builder::filterVariable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilterVariable").build()).build();
private static final SdkField EQ_FIELD = SdkField. builder(MarshallingType.STRING).memberName("EQ")
.getter(getter(DescribeDataSourcesRequest::eq)).setter(setter(Builder::eq))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EQ").build()).build();
private static final SdkField GT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("GT")
.getter(getter(DescribeDataSourcesRequest::gt)).setter(setter(Builder::gt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GT").build()).build();
private static final SdkField LT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("LT")
.getter(getter(DescribeDataSourcesRequest::lt)).setter(setter(Builder::lt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LT").build()).build();
private static final SdkField GE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("GE")
.getter(getter(DescribeDataSourcesRequest::ge)).setter(setter(Builder::ge))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GE").build()).build();
private static final SdkField LE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("LE")
.getter(getter(DescribeDataSourcesRequest::le)).setter(setter(Builder::le))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LE").build()).build();
private static final SdkField NE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("NE")
.getter(getter(DescribeDataSourcesRequest::ne)).setter(setter(Builder::ne))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NE").build()).build();
private static final SdkField PREFIX_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Prefix")
.getter(getter(DescribeDataSourcesRequest::prefix)).setter(setter(Builder::prefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Prefix").build()).build();
private static final SdkField SORT_ORDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SortOrder").getter(getter(DescribeDataSourcesRequest::sortOrderAsString))
.setter(setter(Builder::sortOrder))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SortOrder").build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(DescribeDataSourcesRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final SdkField LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Limit")
.getter(getter(DescribeDataSourcesRequest::limit)).setter(setter(Builder::limit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Limit").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILTER_VARIABLE_FIELD,
EQ_FIELD, GT_FIELD, LT_FIELD, GE_FIELD, LE_FIELD, NE_FIELD, PREFIX_FIELD, SORT_ORDER_FIELD, NEXT_TOKEN_FIELD,
LIMIT_FIELD));
private final String filterVariable;
private final String eq;
private final String gt;
private final String lt;
private final String ge;
private final String le;
private final String ne;
private final String prefix;
private final String sortOrder;
private final String nextToken;
private final Integer limit;
private DescribeDataSourcesRequest(BuilderImpl builder) {
super(builder);
this.filterVariable = builder.filterVariable;
this.eq = builder.eq;
this.gt = builder.gt;
this.lt = builder.lt;
this.ge = builder.ge;
this.le = builder.le;
this.ne = builder.ne;
this.prefix = builder.prefix;
this.sortOrder = builder.sortOrder;
this.nextToken = builder.nextToken;
this.limit = builder.limit;
}
/**
*
* Use one of the following variables to filter a list of DataSource
:
*
*
* -
*
* CreatedAt
- Sets the search criteria to DataSource
creation dates.
*
*
* -
*
* Status
- Sets the search criteria to DataSource
statuses.
*
*
* -
*
* Name
- Sets the search criteria to the contents of DataSource
Name
.
*
*
* -
*
* DataUri
- Sets the search criteria to the URI of data files used to create the
* DataSource
. The URI can identify either a file or an Amazon Simple Storage Service (Amazon S3)
* bucket or directory.
*
*
* -
*
* IAMUser
- Sets the search criteria to the user account that invoked the DataSource
* creation.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #filterVariable}
* will return {@link DataSourceFilterVariable#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #filterVariableAsString}.
*
*
* @return Use one of the following variables to filter a list of DataSource
:
*
* -
*
* CreatedAt
- Sets the search criteria to DataSource
creation dates.
*
*
* -
*
* Status
- Sets the search criteria to DataSource
statuses.
*
*
* -
*
* Name
- Sets the search criteria to the contents of DataSource
Name
* .
*
*
* -
*
* DataUri
- Sets the search criteria to the URI of data files used to create the
* DataSource
. The URI can identify either a file or an Amazon Simple Storage Service (Amazon
* S3) bucket or directory.
*
*
* -
*
* IAMUser
- Sets the search criteria to the user account that invoked the
* DataSource
creation.
*
*
* @see DataSourceFilterVariable
*/
public final DataSourceFilterVariable filterVariable() {
return DataSourceFilterVariable.fromValue(filterVariable);
}
/**
*
* Use one of the following variables to filter a list of DataSource
:
*
*
* -
*
* CreatedAt
- Sets the search criteria to DataSource
creation dates.
*
*
* -
*
* Status
- Sets the search criteria to DataSource
statuses.
*
*
* -
*
* Name
- Sets the search criteria to the contents of DataSource
Name
.
*
*
* -
*
* DataUri
- Sets the search criteria to the URI of data files used to create the
* DataSource
. The URI can identify either a file or an Amazon Simple Storage Service (Amazon S3)
* bucket or directory.
*
*
* -
*
* IAMUser
- Sets the search criteria to the user account that invoked the DataSource
* creation.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #filterVariable}
* will return {@link DataSourceFilterVariable#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #filterVariableAsString}.
*
*
* @return Use one of the following variables to filter a list of DataSource
:
*
* -
*
* CreatedAt
- Sets the search criteria to DataSource
creation dates.
*
*
* -
*
* Status
- Sets the search criteria to DataSource
statuses.
*
*
* -
*
* Name
- Sets the search criteria to the contents of DataSource
Name
* .
*
*
* -
*
* DataUri
- Sets the search criteria to the URI of data files used to create the
* DataSource
. The URI can identify either a file or an Amazon Simple Storage Service (Amazon
* S3) bucket or directory.
*
*
* -
*
* IAMUser
- Sets the search criteria to the user account that invoked the
* DataSource
creation.
*
*
* @see DataSourceFilterVariable
*/
public final String filterVariableAsString() {
return filterVariable;
}
/**
*
* The equal to operator. The DataSource
results will have FilterVariable
values that
* exactly match the value specified with EQ
.
*
*
* @return The equal to operator. The DataSource
results will have FilterVariable
values
* that exactly match the value specified with EQ
.
*/
public final String eq() {
return eq;
}
/**
*
* The greater than operator. The DataSource
results will have FilterVariable
values that
* are greater than the value specified with GT
.
*
*
* @return The greater than operator. The DataSource
results will have FilterVariable
* values that are greater than the value specified with GT
.
*/
public final String gt() {
return gt;
}
/**
*
* The less than operator. The DataSource
results will have FilterVariable
values that are
* less than the value specified with LT
.
*
*
* @return The less than operator. The DataSource
results will have FilterVariable
values
* that are less than the value specified with LT
.
*/
public final String lt() {
return lt;
}
/**
*
* The greater than or equal to operator. The DataSource
results will have FilterVariable
* values that are greater than or equal to the value specified with GE
.
*
*
* @return The greater than or equal to operator. The DataSource
results will have
* FilterVariable
values that are greater than or equal to the value specified with
* GE
.
*/
public final String ge() {
return ge;
}
/**
*
* The less than or equal to operator. The DataSource
results will have FilterVariable
* values that are less than or equal to the value specified with LE
.
*
*
* @return The less than or equal to operator. The DataSource
results will have
* FilterVariable
values that are less than or equal to the value specified with
* LE
.
*/
public final String le() {
return le;
}
/**
*
* The not equal to operator. The DataSource
results will have FilterVariable
values not
* equal to the value specified with NE
.
*
*
* @return The not equal to operator. The DataSource
results will have FilterVariable
* values not equal to the value specified with NE
.
*/
public final String ne() {
return ne;
}
/**
*
* A string that is found at the beginning of a variable, such as Name
or Id
.
*
*
* For example, a DataSource
could have the Name
2014-09-09-HolidayGiftMailer
* . To search for this DataSource
, select Name
for the FilterVariable
and
* any of the following strings for the Prefix
:
*
*
* -
*
* 2014-09
*
*
* -
*
* 2014-09-09
*
*
* -
*
* 2014-09-09-Holiday
*
*
*
*
* @return A string that is found at the beginning of a variable, such as Name
or Id
.
*
* For example, a DataSource
could have the Name
* 2014-09-09-HolidayGiftMailer
. To search for this DataSource
, select
* Name
for the FilterVariable
and any of the following strings for the
* Prefix
:
*
*
* -
*
* 2014-09
*
*
* -
*
* 2014-09-09
*
*
* -
*
* 2014-09-09-Holiday
*
*
*/
public final String prefix() {
return prefix;
}
/**
*
* A two-value parameter that determines the sequence of the resulting list of DataSource
.
*
*
* -
*
* asc
- Arranges the list in ascending order (A-Z, 0-9).
*
*
* -
*
* dsc
- Arranges the list in descending order (Z-A, 9-0).
*
*
*
*
* Results are sorted by FilterVariable
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortOrder#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return A two-value parameter that determines the sequence of the resulting list of DataSource
.
*
* -
*
* asc
- Arranges the list in ascending order (A-Z, 0-9).
*
*
* -
*
* dsc
- Arranges the list in descending order (Z-A, 9-0).
*
*
*
*
* Results are sorted by FilterVariable
.
* @see SortOrder
*/
public final SortOrder sortOrder() {
return SortOrder.fromValue(sortOrder);
}
/**
*
* A two-value parameter that determines the sequence of the resulting list of DataSource
.
*
*
* -
*
* asc
- Arranges the list in ascending order (A-Z, 0-9).
*
*
* -
*
* dsc
- Arranges the list in descending order (Z-A, 9-0).
*
*
*
*
* Results are sorted by FilterVariable
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortOrder#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return A two-value parameter that determines the sequence of the resulting list of DataSource
.
*
* -
*
* asc
- Arranges the list in ascending order (A-Z, 0-9).
*
*
* -
*
* dsc
- Arranges the list in descending order (Z-A, 9-0).
*
*
*
*
* Results are sorted by FilterVariable
.
* @see SortOrder
*/
public final String sortOrderAsString() {
return sortOrder;
}
/**
*
* The ID of the page in the paginated results.
*
*
* @return The ID of the page in the paginated results.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The maximum number of DataSource
to include in the result.
*
*
* @return The maximum number of DataSource
to include in the result.
*/
public final Integer limit() {
return limit;
}
@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(filterVariableAsString());
hashCode = 31 * hashCode + Objects.hashCode(eq());
hashCode = 31 * hashCode + Objects.hashCode(gt());
hashCode = 31 * hashCode + Objects.hashCode(lt());
hashCode = 31 * hashCode + Objects.hashCode(ge());
hashCode = 31 * hashCode + Objects.hashCode(le());
hashCode = 31 * hashCode + Objects.hashCode(ne());
hashCode = 31 * hashCode + Objects.hashCode(prefix());
hashCode = 31 * hashCode + Objects.hashCode(sortOrderAsString());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(limit());
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 DescribeDataSourcesRequest)) {
return false;
}
DescribeDataSourcesRequest other = (DescribeDataSourcesRequest) obj;
return Objects.equals(filterVariableAsString(), other.filterVariableAsString()) && Objects.equals(eq(), other.eq())
&& Objects.equals(gt(), other.gt()) && Objects.equals(lt(), other.lt()) && Objects.equals(ge(), other.ge())
&& Objects.equals(le(), other.le()) && Objects.equals(ne(), other.ne())
&& Objects.equals(prefix(), other.prefix()) && Objects.equals(sortOrderAsString(), other.sortOrderAsString())
&& Objects.equals(nextToken(), other.nextToken()) && Objects.equals(limit(), other.limit());
}
/**
* 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("DescribeDataSourcesRequest").add("FilterVariable", filterVariableAsString()).add("EQ", eq())
.add("GT", gt()).add("LT", lt()).add("GE", ge()).add("LE", le()).add("NE", ne()).add("Prefix", prefix())
.add("SortOrder", sortOrderAsString()).add("NextToken", nextToken()).add("Limit", limit()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FilterVariable":
return Optional.ofNullable(clazz.cast(filterVariableAsString()));
case "EQ":
return Optional.ofNullable(clazz.cast(eq()));
case "GT":
return Optional.ofNullable(clazz.cast(gt()));
case "LT":
return Optional.ofNullable(clazz.cast(lt()));
case "GE":
return Optional.ofNullable(clazz.cast(ge()));
case "LE":
return Optional.ofNullable(clazz.cast(le()));
case "NE":
return Optional.ofNullable(clazz.cast(ne()));
case "Prefix":
return Optional.ofNullable(clazz.cast(prefix()));
case "SortOrder":
return Optional.ofNullable(clazz.cast(sortOrderAsString()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "Limit":
return Optional.ofNullable(clazz.cast(limit()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function