software.amazon.awssdk.services.applicationinsights.model.UpdateApplicationRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of applicationinsights Show documentation
Show all versions of applicationinsights Show documentation
The AWS Java SDK for Application Insights module holds the client classes that are used for
communicating with Application Insights.
/*
* 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.applicationinsights.model;
import java.beans.Transient;
import java.util.Arrays;
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 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.LocationTrait;
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 UpdateApplicationRequest extends ApplicationInsightsRequest implements
ToCopyableBuilder {
private static final SdkField RESOURCE_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResourceGroupName").getter(getter(UpdateApplicationRequest::resourceGroupName))
.setter(setter(Builder::resourceGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceGroupName").build()).build();
private static final SdkField OPS_CENTER_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("OpsCenterEnabled").getter(getter(UpdateApplicationRequest::opsCenterEnabled))
.setter(setter(Builder::opsCenterEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpsCenterEnabled").build()).build();
private static final SdkField CWE_MONITOR_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CWEMonitorEnabled").getter(getter(UpdateApplicationRequest::cweMonitorEnabled))
.setter(setter(Builder::cweMonitorEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CWEMonitorEnabled").build()).build();
private static final SdkField OPS_ITEM_SNS_TOPIC_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OpsItemSNSTopicArn").getter(getter(UpdateApplicationRequest::opsItemSNSTopicArn))
.setter(setter(Builder::opsItemSNSTopicArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpsItemSNSTopicArn").build())
.build();
private static final SdkField REMOVE_SNS_TOPIC_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("RemoveSNSTopic").getter(getter(UpdateApplicationRequest::removeSNSTopic))
.setter(setter(Builder::removeSNSTopic))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoveSNSTopic").build()).build();
private static final SdkField AUTO_CONFIG_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoConfigEnabled").getter(getter(UpdateApplicationRequest::autoConfigEnabled))
.setter(setter(Builder::autoConfigEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoConfigEnabled").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RESOURCE_GROUP_NAME_FIELD,
OPS_CENTER_ENABLED_FIELD, CWE_MONITOR_ENABLED_FIELD, OPS_ITEM_SNS_TOPIC_ARN_FIELD, REMOVE_SNS_TOPIC_FIELD,
AUTO_CONFIG_ENABLED_FIELD));
private final String resourceGroupName;
private final Boolean opsCenterEnabled;
private final Boolean cweMonitorEnabled;
private final String opsItemSNSTopicArn;
private final Boolean removeSNSTopic;
private final Boolean autoConfigEnabled;
private UpdateApplicationRequest(BuilderImpl builder) {
super(builder);
this.resourceGroupName = builder.resourceGroupName;
this.opsCenterEnabled = builder.opsCenterEnabled;
this.cweMonitorEnabled = builder.cweMonitorEnabled;
this.opsItemSNSTopicArn = builder.opsItemSNSTopicArn;
this.removeSNSTopic = builder.removeSNSTopic;
this.autoConfigEnabled = builder.autoConfigEnabled;
}
/**
*
* The name of the resource group.
*
*
* @return The name of the resource group.
*/
public final String resourceGroupName() {
return resourceGroupName;
}
/**
*
* When set to true
, creates opsItems for any problems detected on an application.
*
*
* @return When set to true
, creates opsItems for any problems detected on an application.
*/
public final Boolean opsCenterEnabled() {
return opsCenterEnabled;
}
/**
*
* Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as
* instance terminated
, failed deployment
, and others.
*
*
* @return Indicates whether Application Insights can listen to CloudWatch events for the application resources,
* such as instance terminated
, failed deployment
, and others.
*/
public final Boolean cweMonitorEnabled() {
return cweMonitorEnabled;
}
/**
*
* The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive
* notifications for updates to the opsItem.
*
*
* @return The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to
* receive notifications for updates to the opsItem.
*/
public final String opsItemSNSTopicArn() {
return opsItemSNSTopicArn;
}
/**
*
* Disassociates the SNS topic from the opsItem created for detected problems.
*
*
* @return Disassociates the SNS topic from the opsItem created for detected problems.
*/
public final Boolean removeSNSTopic() {
return removeSNSTopic;
}
/**
* Returns the value of the AutoConfigEnabled property for this object.
*
* @return The value of the AutoConfigEnabled property for this object.
*/
public final Boolean autoConfigEnabled() {
return autoConfigEnabled;
}
@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(resourceGroupName());
hashCode = 31 * hashCode + Objects.hashCode(opsCenterEnabled());
hashCode = 31 * hashCode + Objects.hashCode(cweMonitorEnabled());
hashCode = 31 * hashCode + Objects.hashCode(opsItemSNSTopicArn());
hashCode = 31 * hashCode + Objects.hashCode(removeSNSTopic());
hashCode = 31 * hashCode + Objects.hashCode(autoConfigEnabled());
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 UpdateApplicationRequest)) {
return false;
}
UpdateApplicationRequest other = (UpdateApplicationRequest) obj;
return Objects.equals(resourceGroupName(), other.resourceGroupName())
&& Objects.equals(opsCenterEnabled(), other.opsCenterEnabled())
&& Objects.equals(cweMonitorEnabled(), other.cweMonitorEnabled())
&& Objects.equals(opsItemSNSTopicArn(), other.opsItemSNSTopicArn())
&& Objects.equals(removeSNSTopic(), other.removeSNSTopic())
&& Objects.equals(autoConfigEnabled(), other.autoConfigEnabled());
}
/**
* 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("UpdateApplicationRequest").add("ResourceGroupName", resourceGroupName())
.add("OpsCenterEnabled", opsCenterEnabled()).add("CWEMonitorEnabled", cweMonitorEnabled())
.add("OpsItemSNSTopicArn", opsItemSNSTopicArn()).add("RemoveSNSTopic", removeSNSTopic())
.add("AutoConfigEnabled", autoConfigEnabled()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ResourceGroupName":
return Optional.ofNullable(clazz.cast(resourceGroupName()));
case "OpsCenterEnabled":
return Optional.ofNullable(clazz.cast(opsCenterEnabled()));
case "CWEMonitorEnabled":
return Optional.ofNullable(clazz.cast(cweMonitorEnabled()));
case "OpsItemSNSTopicArn":
return Optional.ofNullable(clazz.cast(opsItemSNSTopicArn()));
case "RemoveSNSTopic":
return Optional.ofNullable(clazz.cast(removeSNSTopic()));
case "AutoConfigEnabled":
return Optional.ofNullable(clazz.cast(autoConfigEnabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function