software.amazon.awssdk.services.applicationdiscovery.model.StartExportTaskRequest Maven / Gradle / Ivy
Show all versions of applicationdiscovery 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.applicationdiscovery.model;
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.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.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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StartExportTaskRequest extends ApplicationDiscoveryRequest implements
ToCopyableBuilder {
private static final SdkField> EXPORT_DATA_FORMAT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("exportDataFormat")
.getter(getter(StartExportTaskRequest::exportDataFormatAsStrings))
.setter(setter(Builder::exportDataFormatWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportDataFormat").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> FILTERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("filters")
.getter(getter(StartExportTaskRequest::filters))
.setter(setter(Builder::filters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("filters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ExportFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("startTime").getter(getter(StartExportTaskRequest::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();
private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("endTime").getter(getter(StartExportTaskRequest::endTime)).setter(setter(Builder::endTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EXPORT_DATA_FORMAT_FIELD,
FILTERS_FIELD, START_TIME_FIELD, END_TIME_FIELD));
private final List exportDataFormat;
private final List filters;
private final Instant startTime;
private final Instant endTime;
private StartExportTaskRequest(BuilderImpl builder) {
super(builder);
this.exportDataFormat = builder.exportDataFormat;
this.filters = builder.filters;
this.startTime = builder.startTime;
this.endTime = builder.endTime;
}
/**
*
* The file format for the returned export data. Default value is CSV
. Note: The
* GRAPHML
option has been deprecated.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasExportDataFormat()} to see if a value was sent in this field.
*
*
* @return The file format for the returned export data. Default value is CSV
. Note: The
* GRAPHML
option has been deprecated.
*/
public List exportDataFormat() {
return ExportDataFormatsCopier.copyStringToEnum(exportDataFormat);
}
/**
* Returns true if the ExportDataFormat property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasExportDataFormat() {
return exportDataFormat != null && !(exportDataFormat instanceof SdkAutoConstructList);
}
/**
*
* The file format for the returned export data. Default value is CSV
. Note: The
* GRAPHML
option has been deprecated.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasExportDataFormat()} to see if a value was sent in this field.
*
*
* @return The file format for the returned export data. Default value is CSV
. Note: The
* GRAPHML
option has been deprecated.
*/
public List exportDataFormatAsStrings() {
return exportDataFormat;
}
/**
* Returns true if the Filters property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasFilters() {
return filters != null && !(filters instanceof SdkAutoConstructList);
}
/**
*
* If a filter is present, it selects the single agentId
of the Application Discovery Agent for which
* data is exported. The agentId
can be found in the results of the DescribeAgents
API or
* CLI. If no filter is present, startTime
and endTime
are ignored and exported data
* includes both Agentless Discovery Connector data and summary data from Application Discovery agents.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasFilters()} to see if a value was sent in this field.
*
*
* @return If a filter is present, it selects the single agentId
of the Application Discovery Agent for
* which data is exported. The agentId
can be found in the results of the
* DescribeAgents
API or CLI. If no filter is present, startTime
and
* endTime
are ignored and exported data includes both Agentless Discovery Connector data and
* summary data from Application Discovery agents.
*/
public List filters() {
return filters;
}
/**
*
* The start timestamp for exported data from the single Application Discovery Agent selected in the filters. If no
* value is specified, data is exported starting from the first data collected by the agent.
*
*
* @return The start timestamp for exported data from the single Application Discovery Agent selected in the
* filters. If no value is specified, data is exported starting from the first data collected by the agent.
*/
public Instant startTime() {
return startTime;
}
/**
*
* The end timestamp for exported data from the single Application Discovery Agent selected in the filters. If no
* value is specified, exported data includes the most recent data collected by the agent.
*
*
* @return The end timestamp for exported data from the single Application Discovery Agent selected in the filters.
* If no value is specified, exported data includes the most recent data collected by the agent.
*/
public Instant endTime() {
return endTime;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasExportDataFormat() ? exportDataFormatAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasFilters() ? filters() : null);
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(endTime());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StartExportTaskRequest)) {
return false;
}
StartExportTaskRequest other = (StartExportTaskRequest) obj;
return hasExportDataFormat() == other.hasExportDataFormat()
&& Objects.equals(exportDataFormatAsStrings(), other.exportDataFormatAsStrings())
&& hasFilters() == other.hasFilters() && Objects.equals(filters(), other.filters())
&& Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime());
}
/**
* 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 String toString() {
return ToString.builder("StartExportTaskRequest")
.add("ExportDataFormat", hasExportDataFormat() ? exportDataFormatAsStrings() : null)
.add("Filters", hasFilters() ? filters() : null).add("StartTime", startTime()).add("EndTime", endTime()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "exportDataFormat":
return Optional.ofNullable(clazz.cast(exportDataFormatAsStrings()));
case "filters":
return Optional.ofNullable(clazz.cast(filters()));
case "startTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "endTime":
return Optional.ofNullable(clazz.cast(endTime()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function