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

software.amazon.awssdk.services.kinesisanalytics.model.ApplicationUpdate Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Kinesis Analytics module holds the client classes that are used for communicating with Amazon Kinesis Analytics Service

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright 2014-2019 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.kinesisanalytics.model;

import java.io.Serializable;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes updates to apply to an existing Amazon Kinesis Analytics application. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ApplicationUpdate implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> INPUT_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ApplicationUpdate::inputUpdates)) .setter(setter(Builder::inputUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputUpdates").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(InputUpdate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField APPLICATION_CODE_UPDATE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ApplicationUpdate::applicationCodeUpdate)).setter(setter(Builder::applicationCodeUpdate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationCodeUpdate").build()) .build(); private static final SdkField> OUTPUT_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ApplicationUpdate::outputUpdates)) .setter(setter(Builder::outputUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputUpdates").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(OutputUpdate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> REFERENCE_DATA_SOURCE_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ApplicationUpdate::referenceDataSourceUpdates)) .setter(setter(Builder::referenceDataSourceUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReferenceDataSourceUpdates").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ReferenceDataSourceUpdate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> CLOUD_WATCH_LOGGING_OPTION_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ApplicationUpdate::cloudWatchLoggingOptionUpdates)) .setter(setter(Builder::cloudWatchLoggingOptionUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLoggingOptionUpdates") .build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(CloudWatchLoggingOptionUpdate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INPUT_UPDATES_FIELD, APPLICATION_CODE_UPDATE_FIELD, OUTPUT_UPDATES_FIELD, REFERENCE_DATA_SOURCE_UPDATES_FIELD, CLOUD_WATCH_LOGGING_OPTION_UPDATES_FIELD)); private static final long serialVersionUID = 1L; private final List inputUpdates; private final String applicationCodeUpdate; private final List outputUpdates; private final List referenceDataSourceUpdates; private final List cloudWatchLoggingOptionUpdates; private ApplicationUpdate(BuilderImpl builder) { this.inputUpdates = builder.inputUpdates; this.applicationCodeUpdate = builder.applicationCodeUpdate; this.outputUpdates = builder.outputUpdates; this.referenceDataSourceUpdates = builder.referenceDataSourceUpdates; this.cloudWatchLoggingOptionUpdates = builder.cloudWatchLoggingOptionUpdates; } /** *

* Describes application input configuration updates. *

*

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

* * @return Describes application input configuration updates. */ public List inputUpdates() { return inputUpdates; } /** *

* Describes application code updates. *

* * @return Describes application code updates. */ public String applicationCodeUpdate() { return applicationCodeUpdate; } /** *

* Describes application output configuration updates. *

*

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

* * @return Describes application output configuration updates. */ public List outputUpdates() { return outputUpdates; } /** *

* Describes application reference data source updates. *

*

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

* * @return Describes application reference data source updates. */ public List referenceDataSourceUpdates() { return referenceDataSourceUpdates; } /** *

* Describes application CloudWatch logging option updates. *

*

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

* * @return Describes application CloudWatch logging option updates. */ public List cloudWatchLoggingOptionUpdates() { return cloudWatchLoggingOptionUpdates; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(inputUpdates()); hashCode = 31 * hashCode + Objects.hashCode(applicationCodeUpdate()); hashCode = 31 * hashCode + Objects.hashCode(outputUpdates()); hashCode = 31 * hashCode + Objects.hashCode(referenceDataSourceUpdates()); hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptionUpdates()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ApplicationUpdate)) { return false; } ApplicationUpdate other = (ApplicationUpdate) obj; return Objects.equals(inputUpdates(), other.inputUpdates()) && Objects.equals(applicationCodeUpdate(), other.applicationCodeUpdate()) && Objects.equals(outputUpdates(), other.outputUpdates()) && Objects.equals(referenceDataSourceUpdates(), other.referenceDataSourceUpdates()) && Objects.equals(cloudWatchLoggingOptionUpdates(), other.cloudWatchLoggingOptionUpdates()); } /** * 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("ApplicationUpdate").add("InputUpdates", inputUpdates()) .add("ApplicationCodeUpdate", applicationCodeUpdate()).add("OutputUpdates", outputUpdates()) .add("ReferenceDataSourceUpdates", referenceDataSourceUpdates()) .add("CloudWatchLoggingOptionUpdates", cloudWatchLoggingOptionUpdates()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "InputUpdates": return Optional.ofNullable(clazz.cast(inputUpdates())); case "ApplicationCodeUpdate": return Optional.ofNullable(clazz.cast(applicationCodeUpdate())); case "OutputUpdates": return Optional.ofNullable(clazz.cast(outputUpdates())); case "ReferenceDataSourceUpdates": return Optional.ofNullable(clazz.cast(referenceDataSourceUpdates())); case "CloudWatchLoggingOptionUpdates": return Optional.ofNullable(clazz.cast(cloudWatchLoggingOptionUpdates())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ApplicationUpdate) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Describes application input configuration updates. *

* * @param inputUpdates * Describes application input configuration updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputUpdates(Collection inputUpdates); /** *

* Describes application input configuration updates. *

* * @param inputUpdates * Describes application input configuration updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputUpdates(InputUpdate... inputUpdates); /** *

* Describes application input configuration updates. *

* 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 #inputUpdates(List)}. * * @param inputUpdates * 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 #inputUpdates(List) */ Builder inputUpdates(Consumer... inputUpdates); /** *

* Describes application code updates. *

* * @param applicationCodeUpdate * Describes application code updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationCodeUpdate(String applicationCodeUpdate); /** *

* Describes application output configuration updates. *

* * @param outputUpdates * Describes application output configuration updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputUpdates(Collection outputUpdates); /** *

* Describes application output configuration updates. *

* * @param outputUpdates * Describes application output configuration updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputUpdates(OutputUpdate... outputUpdates); /** *

* Describes application output configuration updates. *

* 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 #outputUpdates(List)}. * * @param outputUpdates * 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 #outputUpdates(List) */ Builder outputUpdates(Consumer... outputUpdates); /** *

* Describes application reference data source updates. *

* * @param referenceDataSourceUpdates * Describes application reference data source updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder referenceDataSourceUpdates(Collection referenceDataSourceUpdates); /** *

* Describes application reference data source updates. *

* * @param referenceDataSourceUpdates * Describes application reference data source updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder referenceDataSourceUpdates(ReferenceDataSourceUpdate... referenceDataSourceUpdates); /** *

* Describes application reference data source updates. *

* 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 #referenceDataSourceUpdates(List)}. * * @param referenceDataSourceUpdates * 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 #referenceDataSourceUpdates(List) */ Builder referenceDataSourceUpdates(Consumer... referenceDataSourceUpdates); /** *

* Describes application CloudWatch logging option updates. *

* * @param cloudWatchLoggingOptionUpdates * Describes application CloudWatch logging option updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cloudWatchLoggingOptionUpdates(Collection cloudWatchLoggingOptionUpdates); /** *

* Describes application CloudWatch logging option updates. *

* * @param cloudWatchLoggingOptionUpdates * Describes application CloudWatch logging option updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cloudWatchLoggingOptionUpdates(CloudWatchLoggingOptionUpdate... cloudWatchLoggingOptionUpdates); /** *

* Describes application CloudWatch logging option updates. *

* 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 * #cloudWatchLoggingOptionUpdates(List)}. * * @param cloudWatchLoggingOptionUpdates * 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 #cloudWatchLoggingOptionUpdates(List) */ Builder cloudWatchLoggingOptionUpdates(Consumer... cloudWatchLoggingOptionUpdates); } static final class BuilderImpl implements Builder { private List inputUpdates = DefaultSdkAutoConstructList.getInstance(); private String applicationCodeUpdate; private List outputUpdates = DefaultSdkAutoConstructList.getInstance(); private List referenceDataSourceUpdates = DefaultSdkAutoConstructList.getInstance(); private List cloudWatchLoggingOptionUpdates = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ApplicationUpdate model) { inputUpdates(model.inputUpdates); applicationCodeUpdate(model.applicationCodeUpdate); outputUpdates(model.outputUpdates); referenceDataSourceUpdates(model.referenceDataSourceUpdates); cloudWatchLoggingOptionUpdates(model.cloudWatchLoggingOptionUpdates); } public final Collection getInputUpdates() { return inputUpdates != null ? inputUpdates.stream().map(InputUpdate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder inputUpdates(Collection inputUpdates) { this.inputUpdates = InputUpdatesCopier.copy(inputUpdates); return this; } @Override @SafeVarargs public final Builder inputUpdates(InputUpdate... inputUpdates) { inputUpdates(Arrays.asList(inputUpdates)); return this; } @Override @SafeVarargs public final Builder inputUpdates(Consumer... inputUpdates) { inputUpdates(Stream.of(inputUpdates).map(c -> InputUpdate.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setInputUpdates(Collection inputUpdates) { this.inputUpdates = InputUpdatesCopier.copyFromBuilder(inputUpdates); } public final String getApplicationCodeUpdate() { return applicationCodeUpdate; } @Override public final Builder applicationCodeUpdate(String applicationCodeUpdate) { this.applicationCodeUpdate = applicationCodeUpdate; return this; } public final void setApplicationCodeUpdate(String applicationCodeUpdate) { this.applicationCodeUpdate = applicationCodeUpdate; } public final Collection getOutputUpdates() { return outputUpdates != null ? outputUpdates.stream().map(OutputUpdate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder outputUpdates(Collection outputUpdates) { this.outputUpdates = OutputUpdatesCopier.copy(outputUpdates); return this; } @Override @SafeVarargs public final Builder outputUpdates(OutputUpdate... outputUpdates) { outputUpdates(Arrays.asList(outputUpdates)); return this; } @Override @SafeVarargs public final Builder outputUpdates(Consumer... outputUpdates) { outputUpdates(Stream.of(outputUpdates).map(c -> OutputUpdate.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setOutputUpdates(Collection outputUpdates) { this.outputUpdates = OutputUpdatesCopier.copyFromBuilder(outputUpdates); } public final Collection getReferenceDataSourceUpdates() { return referenceDataSourceUpdates != null ? referenceDataSourceUpdates.stream() .map(ReferenceDataSourceUpdate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder referenceDataSourceUpdates(Collection referenceDataSourceUpdates) { this.referenceDataSourceUpdates = ReferenceDataSourceUpdatesCopier.copy(referenceDataSourceUpdates); return this; } @Override @SafeVarargs public final Builder referenceDataSourceUpdates(ReferenceDataSourceUpdate... referenceDataSourceUpdates) { referenceDataSourceUpdates(Arrays.asList(referenceDataSourceUpdates)); return this; } @Override @SafeVarargs public final Builder referenceDataSourceUpdates(Consumer... referenceDataSourceUpdates) { referenceDataSourceUpdates(Stream.of(referenceDataSourceUpdates) .map(c -> ReferenceDataSourceUpdate.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setReferenceDataSourceUpdates( Collection referenceDataSourceUpdates) { this.referenceDataSourceUpdates = ReferenceDataSourceUpdatesCopier.copyFromBuilder(referenceDataSourceUpdates); } public final Collection getCloudWatchLoggingOptionUpdates() { return cloudWatchLoggingOptionUpdates != null ? cloudWatchLoggingOptionUpdates.stream() .map(CloudWatchLoggingOptionUpdate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder cloudWatchLoggingOptionUpdates( Collection cloudWatchLoggingOptionUpdates) { this.cloudWatchLoggingOptionUpdates = CloudWatchLoggingOptionUpdatesCopier.copy(cloudWatchLoggingOptionUpdates); return this; } @Override @SafeVarargs public final Builder cloudWatchLoggingOptionUpdates(CloudWatchLoggingOptionUpdate... cloudWatchLoggingOptionUpdates) { cloudWatchLoggingOptionUpdates(Arrays.asList(cloudWatchLoggingOptionUpdates)); return this; } @Override @SafeVarargs public final Builder cloudWatchLoggingOptionUpdates( Consumer... cloudWatchLoggingOptionUpdates) { cloudWatchLoggingOptionUpdates(Stream.of(cloudWatchLoggingOptionUpdates) .map(c -> CloudWatchLoggingOptionUpdate.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setCloudWatchLoggingOptionUpdates( Collection cloudWatchLoggingOptionUpdates) { this.cloudWatchLoggingOptionUpdates = CloudWatchLoggingOptionUpdatesCopier .copyFromBuilder(cloudWatchLoggingOptionUpdates); } @Override public ApplicationUpdate build() { return new ApplicationUpdate(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy