All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.applicationdiscovery.model.StartExportTaskRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Application Discovery Service module holds the client classes that are used for communicating with AWS Application Discovery Service.

There is a newer version: 2.28.6
Show newest version
/*
 * 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 final 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 final 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 final 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 final 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 final 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 final 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 final Instant endTime() { return endTime; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final 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 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 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 final String toString() { return ToString.builder("StartExportTaskRequest") .add("ExportDataFormat", hasExportDataFormat() ? exportDataFormatAsStrings() : null) .add("Filters", hasFilters() ? filters() : null).add("StartTime", startTime()).add("EndTime", endTime()).build(); } public final 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 final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((StartExportTaskRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ApplicationDiscoveryRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The file format for the returned export data. Default value is CSV. Note: The * GRAPHML option has been deprecated. *

* * @param exportDataFormat * The file format for the returned export data. Default value is CSV. Note: * The GRAPHML option has been deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportDataFormatWithStrings(Collection exportDataFormat); /** *

* The file format for the returned export data. Default value is CSV. Note: The * GRAPHML option has been deprecated. *

* * @param exportDataFormat * The file format for the returned export data. Default value is CSV. Note: * The GRAPHML option has been deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportDataFormatWithStrings(String... exportDataFormat); /** *

* The file format for the returned export data. Default value is CSV. Note: The * GRAPHML option has been deprecated. *

* * @param exportDataFormat * The file format for the returned export data. Default value is CSV. Note: * The GRAPHML option has been deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportDataFormat(Collection exportDataFormat); /** *

* The file format for the returned export data. Default value is CSV. Note: The * GRAPHML option has been deprecated. *

* * @param exportDataFormat * The file format for the returned export data. Default value is CSV. Note: * The GRAPHML option has been deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportDataFormat(ExportDataFormat... exportDataFormat); /** *

* 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. *

* * @param filters * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filters(Collection filters); /** *

* 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. *

* * @param filters * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filters(ExportFilter... filters); /** *

* 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. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #filters(List)}. * * @param filters * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #filters(List) */ Builder filters(Consumer... 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. *

* * @param startTime * 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 Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant 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. *

* * @param endTime * 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 Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ApplicationDiscoveryRequest.BuilderImpl implements Builder { private List exportDataFormat = DefaultSdkAutoConstructList.getInstance(); private List filters = DefaultSdkAutoConstructList.getInstance(); private Instant startTime; private Instant endTime; private BuilderImpl() { } private BuilderImpl(StartExportTaskRequest model) { super(model); exportDataFormatWithStrings(model.exportDataFormat); filters(model.filters); startTime(model.startTime); endTime(model.endTime); } public final Collection getExportDataFormat() { if (exportDataFormat instanceof SdkAutoConstructList) { return null; } return exportDataFormat; } @Override public final Builder exportDataFormatWithStrings(Collection exportDataFormat) { this.exportDataFormat = ExportDataFormatsCopier.copy(exportDataFormat); return this; } @Override @SafeVarargs public final Builder exportDataFormatWithStrings(String... exportDataFormat) { exportDataFormatWithStrings(Arrays.asList(exportDataFormat)); return this; } @Override public final Builder exportDataFormat(Collection exportDataFormat) { this.exportDataFormat = ExportDataFormatsCopier.copyEnumToString(exportDataFormat); return this; } @Override @SafeVarargs public final Builder exportDataFormat(ExportDataFormat... exportDataFormat) { exportDataFormat(Arrays.asList(exportDataFormat)); return this; } public final void setExportDataFormat(Collection exportDataFormat) { this.exportDataFormat = ExportDataFormatsCopier.copy(exportDataFormat); } public final List getFilters() { List result = ExportFiltersCopier.copyToBuilder(this.filters); if (result instanceof SdkAutoConstructList) { return null; } return result; } @Override public final Builder filters(Collection filters) { this.filters = ExportFiltersCopier.copy(filters); return this; } @Override @SafeVarargs public final Builder filters(ExportFilter... filters) { filters(Arrays.asList(filters)); return this; } @Override @SafeVarargs public final Builder filters(Consumer... filters) { filters(Stream.of(filters).map(c -> ExportFilter.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setFilters(Collection filters) { this.filters = ExportFiltersCopier.copyFromBuilder(filters); } public final Instant getStartTime() { return startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } public final Instant getEndTime() { return endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public StartExportTaskRequest build() { return new StartExportTaskRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy