software.amazon.awssdk.services.applicationinsights.model.ApplicationInfo Maven / Gradle / Ivy
Show all versions of applicationinsights Show documentation
/*
* 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.io.Serializable;
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.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes the status of the application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ApplicationInfo implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField RESOURCE_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ApplicationInfo::resourceGroupName)).setter(setter(Builder::resourceGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceGroupName").build()).build();
private static final SdkField LIFE_CYCLE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ApplicationInfo::lifeCycle)).setter(setter(Builder::lifeCycle))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LifeCycle").build()).build();
private static final SdkField OPS_ITEM_SNS_TOPIC_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ApplicationInfo::opsItemSNSTopicArn)).setter(setter(Builder::opsItemSNSTopicArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpsItemSNSTopicArn").build())
.build();
private static final SdkField OPS_CENTER_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(ApplicationInfo::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)
.getter(getter(ApplicationInfo::cweMonitorEnabled)).setter(setter(Builder::cweMonitorEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CWEMonitorEnabled").build()).build();
private static final SdkField REMARKS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ApplicationInfo::remarks)).setter(setter(Builder::remarks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Remarks").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RESOURCE_GROUP_NAME_FIELD,
LIFE_CYCLE_FIELD, OPS_ITEM_SNS_TOPIC_ARN_FIELD, OPS_CENTER_ENABLED_FIELD, CWE_MONITOR_ENABLED_FIELD, REMARKS_FIELD));
private static final long serialVersionUID = 1L;
private final String resourceGroupName;
private final String lifeCycle;
private final String opsItemSNSTopicArn;
private final Boolean opsCenterEnabled;
private final Boolean cweMonitorEnabled;
private final String remarks;
private ApplicationInfo(BuilderImpl builder) {
this.resourceGroupName = builder.resourceGroupName;
this.lifeCycle = builder.lifeCycle;
this.opsItemSNSTopicArn = builder.opsItemSNSTopicArn;
this.opsCenterEnabled = builder.opsCenterEnabled;
this.cweMonitorEnabled = builder.cweMonitorEnabled;
this.remarks = builder.remarks;
}
/**
*
* The name of the resource group used for the application.
*
*
* @return The name of the resource group used for the application.
*/
public String resourceGroupName() {
return resourceGroupName;
}
/**
*
* The lifecycle of the application.
*
*
* @return The lifecycle of the application.
*/
public String lifeCycle() {
return lifeCycle;
}
/**
*
* The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS
* notifications for opsItem updates.
*
*
* @return The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS
* notifications for opsItem updates.
*/
public String opsItemSNSTopicArn() {
return opsItemSNSTopicArn;
}
/**
*
* Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for
* an application.
*
*
* @return Indicates whether Application Insights will create opsItems for any problem detected by Application
* Insights for an application.
*/
public 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 Boolean cweMonitorEnabled() {
return cweMonitorEnabled;
}
/**
*
* The issues on the user side that block Application Insights from successfully monitoring an application. Example
* remarks include:
*
*
* -
*
* “Configuring application, detected 1 Errors, 3 Warnings”
*
*
* -
*
* “Configuring application, detected 1 Unconfigured Components”
*
*
*
*
* @return The issues on the user side that block Application Insights from successfully monitoring an application.
* Example remarks include:
*
* -
*
* “Configuring application, detected 1 Errors, 3 Warnings”
*
*
* -
*
* “Configuring application, detected 1 Unconfigured Components”
*
*
*/
public String remarks() {
return remarks;
}
@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(resourceGroupName());
hashCode = 31 * hashCode + Objects.hashCode(lifeCycle());
hashCode = 31 * hashCode + Objects.hashCode(opsItemSNSTopicArn());
hashCode = 31 * hashCode + Objects.hashCode(opsCenterEnabled());
hashCode = 31 * hashCode + Objects.hashCode(cweMonitorEnabled());
hashCode = 31 * hashCode + Objects.hashCode(remarks());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ApplicationInfo)) {
return false;
}
ApplicationInfo other = (ApplicationInfo) obj;
return Objects.equals(resourceGroupName(), other.resourceGroupName()) && Objects.equals(lifeCycle(), other.lifeCycle())
&& Objects.equals(opsItemSNSTopicArn(), other.opsItemSNSTopicArn())
&& Objects.equals(opsCenterEnabled(), other.opsCenterEnabled())
&& Objects.equals(cweMonitorEnabled(), other.cweMonitorEnabled()) && Objects.equals(remarks(), other.remarks());
}
/**
* 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("ApplicationInfo").add("ResourceGroupName", resourceGroupName()).add("LifeCycle", lifeCycle())
.add("OpsItemSNSTopicArn", opsItemSNSTopicArn()).add("OpsCenterEnabled", opsCenterEnabled())
.add("CWEMonitorEnabled", cweMonitorEnabled()).add("Remarks", remarks()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ResourceGroupName":
return Optional.ofNullable(clazz.cast(resourceGroupName()));
case "LifeCycle":
return Optional.ofNullable(clazz.cast(lifeCycle()));
case "OpsItemSNSTopicArn":
return Optional.ofNullable(clazz.cast(opsItemSNSTopicArn()));
case "OpsCenterEnabled":
return Optional.ofNullable(clazz.cast(opsCenterEnabled()));
case "CWEMonitorEnabled":
return Optional.ofNullable(clazz.cast(cweMonitorEnabled()));
case "Remarks":
return Optional.ofNullable(clazz.cast(remarks()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function