software.amazon.awssdk.services.kinesisanalytics.model.ApplicationUpdate Maven / Gradle / Ivy
Show all versions of kinesisanalytics Show documentation
/*
* 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 extends Builder> 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