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

software.amazon.awssdk.services.iotfleetwise.model.GetCampaignResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Io T Fleet Wise module holds the client classes that are used for communicating with Io T Fleet Wise.

There is a newer version: 2.29.39
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.iotfleetwise.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.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 GetCampaignResponse extends IoTFleetWiseResponse implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(GetCampaignResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
            .getter(getter(GetCampaignResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(GetCampaignResponse::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField SIGNAL_CATALOG_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("signalCatalogArn").getter(getter(GetCampaignResponse::signalCatalogArn))
            .setter(setter(Builder::signalCatalogArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("signalCatalogArn").build()).build();

    private static final SdkField TARGET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("targetArn").getter(getter(GetCampaignResponse::targetArn)).setter(setter(Builder::targetArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetArn").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
            .getter(getter(GetCampaignResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("startTime").getter(getter(GetCampaignResponse::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();

    private static final SdkField EXPIRY_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("expiryTime").getter(getter(GetCampaignResponse::expiryTime)).setter(setter(Builder::expiryTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expiryTime").build()).build();

    private static final SdkField POST_TRIGGER_COLLECTION_DURATION_FIELD = SdkField
            . builder(MarshallingType.LONG)
            .memberName("postTriggerCollectionDuration")
            .getter(getter(GetCampaignResponse::postTriggerCollectionDuration))
            .setter(setter(Builder::postTriggerCollectionDuration))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("postTriggerCollectionDuration")
                    .build()).build();

    private static final SdkField DIAGNOSTICS_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("diagnosticsMode").getter(getter(GetCampaignResponse::diagnosticsModeAsString))
            .setter(setter(Builder::diagnosticsMode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("diagnosticsMode").build()).build();

    private static final SdkField SPOOLING_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("spoolingMode").getter(getter(GetCampaignResponse::spoolingModeAsString))
            .setter(setter(Builder::spoolingMode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("spoolingMode").build()).build();

    private static final SdkField COMPRESSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("compression").getter(getter(GetCampaignResponse::compressionAsString))
            .setter(setter(Builder::compression))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("compression").build()).build();

    private static final SdkField PRIORITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("priority").getter(getter(GetCampaignResponse::priority)).setter(setter(Builder::priority))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("priority").build()).build();

    private static final SdkField> SIGNALS_TO_COLLECT_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("signalsToCollect")
            .getter(getter(GetCampaignResponse::signalsToCollect))
            .setter(setter(Builder::signalsToCollect))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("signalsToCollect").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(SignalInformation::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField COLLECTION_SCHEME_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("collectionScheme")
            .getter(getter(GetCampaignResponse::collectionScheme)).setter(setter(Builder::collectionScheme))
            .constructor(CollectionScheme::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("collectionScheme").build()).build();

    private static final SdkField> DATA_EXTRA_DIMENSIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("dataExtraDimensions")
            .getter(getter(GetCampaignResponse::dataExtraDimensions))
            .setter(setter(Builder::dataExtraDimensions))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataExtraDimensions").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 CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("creationTime").getter(getter(GetCampaignResponse::creationTime)).setter(setter(Builder::creationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build()).build();

    private static final SdkField LAST_MODIFICATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("lastModificationTime").getter(getter(GetCampaignResponse::lastModificationTime))
            .setter(setter(Builder::lastModificationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModificationTime").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, ARN_FIELD,
            DESCRIPTION_FIELD, SIGNAL_CATALOG_ARN_FIELD, TARGET_ARN_FIELD, STATUS_FIELD, START_TIME_FIELD, EXPIRY_TIME_FIELD,
            POST_TRIGGER_COLLECTION_DURATION_FIELD, DIAGNOSTICS_MODE_FIELD, SPOOLING_MODE_FIELD, COMPRESSION_FIELD,
            PRIORITY_FIELD, SIGNALS_TO_COLLECT_FIELD, COLLECTION_SCHEME_FIELD, DATA_EXTRA_DIMENSIONS_FIELD, CREATION_TIME_FIELD,
            LAST_MODIFICATION_TIME_FIELD));

    private final String name;

    private final String arn;

    private final String description;

    private final String signalCatalogArn;

    private final String targetArn;

    private final String status;

    private final Instant startTime;

    private final Instant expiryTime;

    private final Long postTriggerCollectionDuration;

    private final String diagnosticsMode;

    private final String spoolingMode;

    private final String compression;

    private final Integer priority;

    private final List signalsToCollect;

    private final CollectionScheme collectionScheme;

    private final List dataExtraDimensions;

    private final Instant creationTime;

    private final Instant lastModificationTime;

    private GetCampaignResponse(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.arn = builder.arn;
        this.description = builder.description;
        this.signalCatalogArn = builder.signalCatalogArn;
        this.targetArn = builder.targetArn;
        this.status = builder.status;
        this.startTime = builder.startTime;
        this.expiryTime = builder.expiryTime;
        this.postTriggerCollectionDuration = builder.postTriggerCollectionDuration;
        this.diagnosticsMode = builder.diagnosticsMode;
        this.spoolingMode = builder.spoolingMode;
        this.compression = builder.compression;
        this.priority = builder.priority;
        this.signalsToCollect = builder.signalsToCollect;
        this.collectionScheme = builder.collectionScheme;
        this.dataExtraDimensions = builder.dataExtraDimensions;
        this.creationTime = builder.creationTime;
        this.lastModificationTime = builder.lastModificationTime;
    }

    /**
     * 

* The name of the campaign. *

* * @return The name of the campaign. */ public final String name() { return name; } /** *

* The Amazon Resource Name (ARN) of the campaign. *

* * @return The Amazon Resource Name (ARN) of the campaign. */ public final String arn() { return arn; } /** *

* The description of the campaign. *

* * @return The description of the campaign. */ public final String description() { return description; } /** *

* The ARN of a signal catalog. *

* * @return The ARN of a signal catalog. */ public final String signalCatalogArn() { return signalCatalogArn; } /** *

* The ARN of the vehicle or the fleet targeted by the campaign. *

* * @return The ARN of the vehicle or the fleet targeted by the campaign. */ public final String targetArn() { return targetArn; } /** *

* The state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, * RUNNING, and SUSPENDED. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link CampaignStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The state of the campaign. The status can be one of: CREATING, * WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. * @see CampaignStatus */ public final CampaignStatus status() { return CampaignStatus.fromValue(status); } /** *

* The state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, * RUNNING, and SUSPENDED. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link CampaignStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The state of the campaign. The status can be one of: CREATING, * WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. * @see CampaignStatus */ public final String statusAsString() { return status; } /** *

* The time, in milliseconds, to deliver a campaign after it was approved. *

* * @return The time, in milliseconds, to deliver a campaign after it was approved. */ public final Instant startTime() { return startTime; } /** *

* The time the campaign expires, in seconds since epoch (January 1, 1970 at midnight UTC time). Vehicle data won't * be collected after the campaign expires. *

* * @return The time the campaign expires, in seconds since epoch (January 1, 1970 at midnight UTC time). Vehicle * data won't be collected after the campaign expires. */ public final Instant expiryTime() { return expiryTime; } /** *

* How long (in seconds) to collect raw data after a triggering event initiates the collection. *

* * @return How long (in seconds) to collect raw data after a triggering event initiates the collection. */ public final Long postTriggerCollectionDuration() { return postTriggerCollectionDuration; } /** *

* Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #diagnosticsMode} * will return {@link DiagnosticsMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #diagnosticsModeAsString}. *

* * @return Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. * @see DiagnosticsMode */ public final DiagnosticsMode diagnosticsMode() { return DiagnosticsMode.fromValue(diagnosticsMode); } /** *

* Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #diagnosticsMode} * will return {@link DiagnosticsMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #diagnosticsModeAsString}. *

* * @return Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. * @see DiagnosticsMode */ public final String diagnosticsModeAsString() { return diagnosticsMode; } /** *

* Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #spoolingMode} will * return {@link SpoolingMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #spoolingModeAsString}. *

* * @return Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. * @see SpoolingMode */ public final SpoolingMode spoolingMode() { return SpoolingMode.fromValue(spoolingMode); } /** *

* Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #spoolingMode} will * return {@link SpoolingMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #spoolingModeAsString}. *

* * @return Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. * @see SpoolingMode */ public final String spoolingModeAsString() { return spoolingMode; } /** *

* Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If OFF is * specified, the signals aren't compressed. If it's not specified, SNAPPY is used. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #compression} will * return {@link Compression#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #compressionAsString}. *

* * @return Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, SNAPPY * is used. * @see Compression */ public final Compression compression() { return Compression.fromValue(compression); } /** *

* Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If OFF is * specified, the signals aren't compressed. If it's not specified, SNAPPY is used. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #compression} will * return {@link Compression#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #compressionAsString}. *

* * @return Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, SNAPPY * is used. * @see Compression */ public final String compressionAsString() { return compression; } /** *

* A number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. A campaign * with the lowest value is deployed to vehicles before any other campaigns. *

* * @return A number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. A * campaign with the lowest value is deployed to vehicles before any other campaigns. */ public final Integer priority() { return priority; } /** * For responses, this returns true if the service returned a value for the SignalsToCollect property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasSignalsToCollect() { return signalsToCollect != null && !(signalsToCollect instanceof SdkAutoConstructList); } /** *

* Information about a list of signals to collect data on. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSignalsToCollect} method. *

* * @return Information about a list of signals to collect data on. */ public final List signalsToCollect() { return signalsToCollect; } /** *

* Information about the data collection scheme associated with the campaign. *

* * @return Information about the data collection scheme associated with the campaign. */ public final CollectionScheme collectionScheme() { return collectionScheme; } /** * For responses, this returns true if the service returned a value for the DataExtraDimensions property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasDataExtraDimensions() { return dataExtraDimensions != null && !(dataExtraDimensions instanceof SdkAutoConstructList); } /** *

* A list of vehicle attributes associated with the campaign. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasDataExtraDimensions} method. *

* * @return A list of vehicle attributes associated with the campaign. */ public final List dataExtraDimensions() { return dataExtraDimensions; } /** *

* The time the campaign was created in seconds since epoch (January 1, 1970 at midnight UTC time). *

* * @return The time the campaign was created in seconds since epoch (January 1, 1970 at midnight UTC time). */ public final Instant creationTime() { return creationTime; } /** *

* The last time the campaign was modified. *

* * @return The last time the campaign was modified. */ public final Instant lastModificationTime() { return lastModificationTime; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(signalCatalogArn()); hashCode = 31 * hashCode + Objects.hashCode(targetArn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(expiryTime()); hashCode = 31 * hashCode + Objects.hashCode(postTriggerCollectionDuration()); hashCode = 31 * hashCode + Objects.hashCode(diagnosticsModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(spoolingModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(compressionAsString()); hashCode = 31 * hashCode + Objects.hashCode(priority()); hashCode = 31 * hashCode + Objects.hashCode(hasSignalsToCollect() ? signalsToCollect() : null); hashCode = 31 * hashCode + Objects.hashCode(collectionScheme()); hashCode = 31 * hashCode + Objects.hashCode(hasDataExtraDimensions() ? dataExtraDimensions() : null); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModificationTime()); 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 GetCampaignResponse)) { return false; } GetCampaignResponse other = (GetCampaignResponse) obj; return Objects.equals(name(), other.name()) && Objects.equals(arn(), other.arn()) && Objects.equals(description(), other.description()) && Objects.equals(signalCatalogArn(), other.signalCatalogArn()) && Objects.equals(targetArn(), other.targetArn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(expiryTime(), other.expiryTime()) && Objects.equals(postTriggerCollectionDuration(), other.postTriggerCollectionDuration()) && Objects.equals(diagnosticsModeAsString(), other.diagnosticsModeAsString()) && Objects.equals(spoolingModeAsString(), other.spoolingModeAsString()) && Objects.equals(compressionAsString(), other.compressionAsString()) && Objects.equals(priority(), other.priority()) && hasSignalsToCollect() == other.hasSignalsToCollect() && Objects.equals(signalsToCollect(), other.signalsToCollect()) && Objects.equals(collectionScheme(), other.collectionScheme()) && hasDataExtraDimensions() == other.hasDataExtraDimensions() && Objects.equals(dataExtraDimensions(), other.dataExtraDimensions()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(lastModificationTime(), other.lastModificationTime()); } /** * 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("GetCampaignResponse").add("Name", name()).add("Arn", arn()).add("Description", description()) .add("SignalCatalogArn", signalCatalogArn()).add("TargetArn", targetArn()).add("Status", statusAsString()) .add("StartTime", startTime()).add("ExpiryTime", expiryTime()) .add("PostTriggerCollectionDuration", postTriggerCollectionDuration()) .add("DiagnosticsMode", diagnosticsModeAsString()).add("SpoolingMode", spoolingModeAsString()) .add("Compression", compressionAsString()).add("Priority", priority()) .add("SignalsToCollect", hasSignalsToCollect() ? signalsToCollect() : null) .add("CollectionScheme", collectionScheme()) .add("DataExtraDimensions", hasDataExtraDimensions() ? dataExtraDimensions() : null) .add("CreationTime", creationTime()).add("LastModificationTime", lastModificationTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "description": return Optional.ofNullable(clazz.cast(description())); case "signalCatalogArn": return Optional.ofNullable(clazz.cast(signalCatalogArn())); case "targetArn": return Optional.ofNullable(clazz.cast(targetArn())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); case "expiryTime": return Optional.ofNullable(clazz.cast(expiryTime())); case "postTriggerCollectionDuration": return Optional.ofNullable(clazz.cast(postTriggerCollectionDuration())); case "diagnosticsMode": return Optional.ofNullable(clazz.cast(diagnosticsModeAsString())); case "spoolingMode": return Optional.ofNullable(clazz.cast(spoolingModeAsString())); case "compression": return Optional.ofNullable(clazz.cast(compressionAsString())); case "priority": return Optional.ofNullable(clazz.cast(priority())); case "signalsToCollect": return Optional.ofNullable(clazz.cast(signalsToCollect())); case "collectionScheme": return Optional.ofNullable(clazz.cast(collectionScheme())); case "dataExtraDimensions": return Optional.ofNullable(clazz.cast(dataExtraDimensions())); case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "lastModificationTime": return Optional.ofNullable(clazz.cast(lastModificationTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetCampaignResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends IoTFleetWiseResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the campaign. *

* * @param name * The name of the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The Amazon Resource Name (ARN) of the campaign. *

* * @param arn * The Amazon Resource Name (ARN) of the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The description of the campaign. *

* * @param description * The description of the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The ARN of a signal catalog. *

* * @param signalCatalogArn * The ARN of a signal catalog. * @return Returns a reference to this object so that method calls can be chained together. */ Builder signalCatalogArn(String signalCatalogArn); /** *

* The ARN of the vehicle or the fleet targeted by the campaign. *

* * @param targetArn * The ARN of the vehicle or the fleet targeted by the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetArn(String targetArn); /** *

* The state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. *

* * @param status * The state of the campaign. The status can be one of: CREATING, * WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. * @see CampaignStatus * @return Returns a reference to this object so that method calls can be chained together. * @see CampaignStatus */ Builder status(String status); /** *

* The state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. *

* * @param status * The state of the campaign. The status can be one of: CREATING, * WAITING_FOR_APPROVAL, RUNNING, and SUSPENDED. * @see CampaignStatus * @return Returns a reference to this object so that method calls can be chained together. * @see CampaignStatus */ Builder status(CampaignStatus status); /** *

* The time, in milliseconds, to deliver a campaign after it was approved. *

* * @param startTime * The time, in milliseconds, to deliver a campaign after it was approved. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The time the campaign expires, in seconds since epoch (January 1, 1970 at midnight UTC time). Vehicle data * won't be collected after the campaign expires. *

* * @param expiryTime * The time the campaign expires, in seconds since epoch (January 1, 1970 at midnight UTC time). Vehicle * data won't be collected after the campaign expires. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expiryTime(Instant expiryTime); /** *

* How long (in seconds) to collect raw data after a triggering event initiates the collection. *

* * @param postTriggerCollectionDuration * How long (in seconds) to collect raw data after a triggering event initiates the collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder postTriggerCollectionDuration(Long postTriggerCollectionDuration); /** *

* Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. *

* * @param diagnosticsMode * Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. * @see DiagnosticsMode * @return Returns a reference to this object so that method calls can be chained together. * @see DiagnosticsMode */ Builder diagnosticsMode(String diagnosticsMode); /** *

* Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. *

* * @param diagnosticsMode * Option for a vehicle to send diagnostic trouble codes to Amazon Web Services IoT FleetWise. * @see DiagnosticsMode * @return Returns a reference to this object so that method calls can be chained together. * @see DiagnosticsMode */ Builder diagnosticsMode(DiagnosticsMode diagnosticsMode); /** *

* Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. *

* * @param spoolingMode * Whether to store collected data after a vehicle lost a connection with the cloud. After a connection * is re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. * @see SpoolingMode * @return Returns a reference to this object so that method calls can be chained together. * @see SpoolingMode */ Builder spoolingMode(String spoolingMode); /** *

* Whether to store collected data after a vehicle lost a connection with the cloud. After a connection is * re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. *

* * @param spoolingMode * Whether to store collected data after a vehicle lost a connection with the cloud. After a connection * is re-established, the data is automatically forwarded to Amazon Web Services IoT FleetWise. * @see SpoolingMode * @return Returns a reference to this object so that method calls can be chained together. * @see SpoolingMode */ Builder spoolingMode(SpoolingMode spoolingMode); /** *

* Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, SNAPPY is * used. *

* * @param compression * Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, * SNAPPY is used. * @see Compression * @return Returns a reference to this object so that method calls can be chained together. * @see Compression */ Builder compression(String compression); /** *

* Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, SNAPPY is * used. *

* * @param compression * Whether to compress signals before transmitting data to Amazon Web Services IoT FleetWise. If * OFF is specified, the signals aren't compressed. If it's not specified, * SNAPPY is used. * @see Compression * @return Returns a reference to this object so that method calls can be chained together. * @see Compression */ Builder compression(Compression compression); /** *

* A number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. A * campaign with the lowest value is deployed to vehicles before any other campaigns. *

* * @param priority * A number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. * A campaign with the lowest value is deployed to vehicles before any other campaigns. * @return Returns a reference to this object so that method calls can be chained together. */ Builder priority(Integer priority); /** *

* Information about a list of signals to collect data on. *

* * @param signalsToCollect * Information about a list of signals to collect data on. * @return Returns a reference to this object so that method calls can be chained together. */ Builder signalsToCollect(Collection signalsToCollect); /** *

* Information about a list of signals to collect data on. *

* * @param signalsToCollect * Information about a list of signals to collect data on. * @return Returns a reference to this object so that method calls can be chained together. */ Builder signalsToCollect(SignalInformation... signalsToCollect); /** *

* Information about a list of signals to collect data on. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.iotfleetwise.model.SignalInformation.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.iotfleetwise.model.SignalInformation#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.iotfleetwise.model.SignalInformation.Builder#build()} is called * immediately and its result is passed to {@link #signalsToCollect(List)}. * * @param signalsToCollect * a consumer that will call methods on * {@link software.amazon.awssdk.services.iotfleetwise.model.SignalInformation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #signalsToCollect(java.util.Collection) */ Builder signalsToCollect(Consumer... signalsToCollect); /** *

* Information about the data collection scheme associated with the campaign. *

* * @param collectionScheme * Information about the data collection scheme associated with the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder collectionScheme(CollectionScheme collectionScheme); /** *

* Information about the data collection scheme associated with the campaign. *

* This is a convenience method that creates an instance of the {@link CollectionScheme.Builder} avoiding the * need to create one manually via {@link CollectionScheme#builder()}. * *

* When the {@link Consumer} completes, {@link CollectionScheme.Builder#build()} is called immediately and its * result is passed to {@link #collectionScheme(CollectionScheme)}. * * @param collectionScheme * a consumer that will call methods on {@link CollectionScheme.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #collectionScheme(CollectionScheme) */ default Builder collectionScheme(Consumer collectionScheme) { return collectionScheme(CollectionScheme.builder().applyMutation(collectionScheme).build()); } /** *

* A list of vehicle attributes associated with the campaign. *

* * @param dataExtraDimensions * A list of vehicle attributes associated with the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataExtraDimensions(Collection dataExtraDimensions); /** *

* A list of vehicle attributes associated with the campaign. *

* * @param dataExtraDimensions * A list of vehicle attributes associated with the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataExtraDimensions(String... dataExtraDimensions); /** *

* The time the campaign was created in seconds since epoch (January 1, 1970 at midnight UTC time). *

* * @param creationTime * The time the campaign was created in seconds since epoch (January 1, 1970 at midnight UTC time). * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* The last time the campaign was modified. *

* * @param lastModificationTime * The last time the campaign was modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModificationTime(Instant lastModificationTime); } static final class BuilderImpl extends IoTFleetWiseResponse.BuilderImpl implements Builder { private String name; private String arn; private String description; private String signalCatalogArn; private String targetArn; private String status; private Instant startTime; private Instant expiryTime; private Long postTriggerCollectionDuration; private String diagnosticsMode; private String spoolingMode; private String compression; private Integer priority; private List signalsToCollect = DefaultSdkAutoConstructList.getInstance(); private CollectionScheme collectionScheme; private List dataExtraDimensions = DefaultSdkAutoConstructList.getInstance(); private Instant creationTime; private Instant lastModificationTime; private BuilderImpl() { } private BuilderImpl(GetCampaignResponse model) { super(model); name(model.name); arn(model.arn); description(model.description); signalCatalogArn(model.signalCatalogArn); targetArn(model.targetArn); status(model.status); startTime(model.startTime); expiryTime(model.expiryTime); postTriggerCollectionDuration(model.postTriggerCollectionDuration); diagnosticsMode(model.diagnosticsMode); spoolingMode(model.spoolingMode); compression(model.compression); priority(model.priority); signalsToCollect(model.signalsToCollect); collectionScheme(model.collectionScheme); dataExtraDimensions(model.dataExtraDimensions); creationTime(model.creationTime); lastModificationTime(model.lastModificationTime); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getSignalCatalogArn() { return signalCatalogArn; } public final void setSignalCatalogArn(String signalCatalogArn) { this.signalCatalogArn = signalCatalogArn; } @Override public final Builder signalCatalogArn(String signalCatalogArn) { this.signalCatalogArn = signalCatalogArn; return this; } public final String getTargetArn() { return targetArn; } public final void setTargetArn(String targetArn) { this.targetArn = targetArn; } @Override public final Builder targetArn(String targetArn) { this.targetArn = targetArn; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(CampaignStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getExpiryTime() { return expiryTime; } public final void setExpiryTime(Instant expiryTime) { this.expiryTime = expiryTime; } @Override public final Builder expiryTime(Instant expiryTime) { this.expiryTime = expiryTime; return this; } public final Long getPostTriggerCollectionDuration() { return postTriggerCollectionDuration; } public final void setPostTriggerCollectionDuration(Long postTriggerCollectionDuration) { this.postTriggerCollectionDuration = postTriggerCollectionDuration; } @Override public final Builder postTriggerCollectionDuration(Long postTriggerCollectionDuration) { this.postTriggerCollectionDuration = postTriggerCollectionDuration; return this; } public final String getDiagnosticsMode() { return diagnosticsMode; } public final void setDiagnosticsMode(String diagnosticsMode) { this.diagnosticsMode = diagnosticsMode; } @Override public final Builder diagnosticsMode(String diagnosticsMode) { this.diagnosticsMode = diagnosticsMode; return this; } @Override public final Builder diagnosticsMode(DiagnosticsMode diagnosticsMode) { this.diagnosticsMode(diagnosticsMode == null ? null : diagnosticsMode.toString()); return this; } public final String getSpoolingMode() { return spoolingMode; } public final void setSpoolingMode(String spoolingMode) { this.spoolingMode = spoolingMode; } @Override public final Builder spoolingMode(String spoolingMode) { this.spoolingMode = spoolingMode; return this; } @Override public final Builder spoolingMode(SpoolingMode spoolingMode) { this.spoolingMode(spoolingMode == null ? null : spoolingMode.toString()); return this; } public final String getCompression() { return compression; } public final void setCompression(String compression) { this.compression = compression; } @Override public final Builder compression(String compression) { this.compression = compression; return this; } @Override public final Builder compression(Compression compression) { this.compression(compression == null ? null : compression.toString()); return this; } public final Integer getPriority() { return priority; } public final void setPriority(Integer priority) { this.priority = priority; } @Override public final Builder priority(Integer priority) { this.priority = priority; return this; } public final List getSignalsToCollect() { List result = SignalInformationListCopier.copyToBuilder(this.signalsToCollect); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSignalsToCollect(Collection signalsToCollect) { this.signalsToCollect = SignalInformationListCopier.copyFromBuilder(signalsToCollect); } @Override public final Builder signalsToCollect(Collection signalsToCollect) { this.signalsToCollect = SignalInformationListCopier.copy(signalsToCollect); return this; } @Override @SafeVarargs public final Builder signalsToCollect(SignalInformation... signalsToCollect) { signalsToCollect(Arrays.asList(signalsToCollect)); return this; } @Override @SafeVarargs public final Builder signalsToCollect(Consumer... signalsToCollect) { signalsToCollect(Stream.of(signalsToCollect).map(c -> SignalInformation.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final CollectionScheme.Builder getCollectionScheme() { return collectionScheme != null ? collectionScheme.toBuilder() : null; } public final void setCollectionScheme(CollectionScheme.BuilderImpl collectionScheme) { this.collectionScheme = collectionScheme != null ? collectionScheme.build() : null; } @Override public final Builder collectionScheme(CollectionScheme collectionScheme) { this.collectionScheme = collectionScheme; return this; } public final Collection getDataExtraDimensions() { if (dataExtraDimensions instanceof SdkAutoConstructList) { return null; } return dataExtraDimensions; } public final void setDataExtraDimensions(Collection dataExtraDimensions) { this.dataExtraDimensions = DataExtraDimensionNodePathListCopier.copy(dataExtraDimensions); } @Override public final Builder dataExtraDimensions(Collection dataExtraDimensions) { this.dataExtraDimensions = DataExtraDimensionNodePathListCopier.copy(dataExtraDimensions); return this; } @Override @SafeVarargs public final Builder dataExtraDimensions(String... dataExtraDimensions) { dataExtraDimensions(Arrays.asList(dataExtraDimensions)); return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getLastModificationTime() { return lastModificationTime; } public final void setLastModificationTime(Instant lastModificationTime) { this.lastModificationTime = lastModificationTime; } @Override public final Builder lastModificationTime(Instant lastModificationTime) { this.lastModificationTime = lastModificationTime; return this; } @Override public GetCampaignResponse build() { return new GetCampaignResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy