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

software.amazon.awssdk.services.applicationinsights.model.UpdateApplicationRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Application Insights module holds the client classes that are used for communicating with Application Insights.

There is a newer version: 2.29.15
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.applicationinsights.model;

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 SdkField ATTACH_MISSING_PERMISSION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("AttachMissingPermission").getter(getter(UpdateApplicationRequest::attachMissingPermission))
            .setter(setter(Builder::attachMissingPermission))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachMissingPermission").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, ATTACH_MISSING_PERMISSION_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 final Boolean attachMissingPermission;

    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;
        this.attachMissingPermission = builder.attachMissingPermission;
    }

    /**
     * 

* 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; } /** *

* Turns auto-configuration on or off. *

* * @return Turns auto-configuration on or off. */ public final Boolean autoConfigEnabled() { return autoConfigEnabled; } /** *

* If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing. *

* * @return If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are * missing. */ public final Boolean attachMissingPermission() { return attachMissingPermission; } @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()); hashCode = 31 * hashCode + Objects.hashCode(attachMissingPermission()); 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()) && Objects.equals(attachMissingPermission(), other.attachMissingPermission()); } /** * 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()).add("AttachMissingPermission", attachMissingPermission()).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())); case "AttachMissingPermission": return Optional.ofNullable(clazz.cast(attachMissingPermission())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateApplicationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ApplicationInsightsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the resource group. *

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

* When set to true, creates opsItems for any problems detected on an application. *

* * @param opsCenterEnabled * When set to true, creates opsItems for any problems detected on an application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder opsCenterEnabled(Boolean opsCenterEnabled); /** *

* Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as * instance terminated, failed deployment, and others. *

* * @param cweMonitorEnabled * Indicates whether Application Insights can listen to CloudWatch events for the application resources, * such as instance terminated, failed deployment, and others. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cweMonitorEnabled(Boolean 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. *

* * @param opsItemSNSTopicArn * 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 Returns a reference to this object so that method calls can be chained together. */ Builder opsItemSNSTopicArn(String opsItemSNSTopicArn); /** *

* Disassociates the SNS topic from the opsItem created for detected problems. *

* * @param removeSNSTopic * Disassociates the SNS topic from the opsItem created for detected problems. * @return Returns a reference to this object so that method calls can be chained together. */ Builder removeSNSTopic(Boolean removeSNSTopic); /** *

* Turns auto-configuration on or off. *

* * @param autoConfigEnabled * Turns auto-configuration on or off. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoConfigEnabled(Boolean autoConfigEnabled); /** *

* If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are * missing. *

* * @param attachMissingPermission * If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are * missing. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attachMissingPermission(Boolean attachMissingPermission); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ApplicationInsightsRequest.BuilderImpl implements Builder { private String resourceGroupName; private Boolean opsCenterEnabled; private Boolean cweMonitorEnabled; private String opsItemSNSTopicArn; private Boolean removeSNSTopic; private Boolean autoConfigEnabled; private Boolean attachMissingPermission; private BuilderImpl() { } private BuilderImpl(UpdateApplicationRequest model) { super(model); resourceGroupName(model.resourceGroupName); opsCenterEnabled(model.opsCenterEnabled); cweMonitorEnabled(model.cweMonitorEnabled); opsItemSNSTopicArn(model.opsItemSNSTopicArn); removeSNSTopic(model.removeSNSTopic); autoConfigEnabled(model.autoConfigEnabled); attachMissingPermission(model.attachMissingPermission); } public final String getResourceGroupName() { return resourceGroupName; } public final void setResourceGroupName(String resourceGroupName) { this.resourceGroupName = resourceGroupName; } @Override public final Builder resourceGroupName(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; } public final Boolean getOpsCenterEnabled() { return opsCenterEnabled; } public final void setOpsCenterEnabled(Boolean opsCenterEnabled) { this.opsCenterEnabled = opsCenterEnabled; } @Override public final Builder opsCenterEnabled(Boolean opsCenterEnabled) { this.opsCenterEnabled = opsCenterEnabled; return this; } public final Boolean getCweMonitorEnabled() { return cweMonitorEnabled; } public final void setCweMonitorEnabled(Boolean cweMonitorEnabled) { this.cweMonitorEnabled = cweMonitorEnabled; } @Override public final Builder cweMonitorEnabled(Boolean cweMonitorEnabled) { this.cweMonitorEnabled = cweMonitorEnabled; return this; } public final String getOpsItemSNSTopicArn() { return opsItemSNSTopicArn; } public final void setOpsItemSNSTopicArn(String opsItemSNSTopicArn) { this.opsItemSNSTopicArn = opsItemSNSTopicArn; } @Override public final Builder opsItemSNSTopicArn(String opsItemSNSTopicArn) { this.opsItemSNSTopicArn = opsItemSNSTopicArn; return this; } public final Boolean getRemoveSNSTopic() { return removeSNSTopic; } public final void setRemoveSNSTopic(Boolean removeSNSTopic) { this.removeSNSTopic = removeSNSTopic; } @Override public final Builder removeSNSTopic(Boolean removeSNSTopic) { this.removeSNSTopic = removeSNSTopic; return this; } public final Boolean getAutoConfigEnabled() { return autoConfigEnabled; } public final void setAutoConfigEnabled(Boolean autoConfigEnabled) { this.autoConfigEnabled = autoConfigEnabled; } @Override public final Builder autoConfigEnabled(Boolean autoConfigEnabled) { this.autoConfigEnabled = autoConfigEnabled; return this; } public final Boolean getAttachMissingPermission() { return attachMissingPermission; } public final void setAttachMissingPermission(Boolean attachMissingPermission) { this.attachMissingPermission = attachMissingPermission; } @Override public final Builder attachMissingPermission(Boolean attachMissingPermission) { this.attachMissingPermission = attachMissingPermission; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateApplicationRequest build() { return new UpdateApplicationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy