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

software.amazon.awssdk.services.inspector2.model.AutoEnable Maven / Gradle / Ivy

/*
 * 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.inspector2.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;

/**
 * 

* Represents which scan types are automatically enabled for new members of your Amazon Inspector organization. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AutoEnable implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField EC2_FIELD = SdkField. builder(MarshallingType.BOOLEAN).memberName("ec2") .getter(getter(AutoEnable::ec2)).setter(setter(Builder::ec2)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ec2").build()).build(); private static final SdkField ECR_FIELD = SdkField. builder(MarshallingType.BOOLEAN).memberName("ecr") .getter(getter(AutoEnable::ecr)).setter(setter(Builder::ecr)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ecr").build()).build(); private static final SdkField LAMBDA_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("lambda").getter(getter(AutoEnable::lambda)).setter(setter(Builder::lambda)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lambda").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EC2_FIELD, ECR_FIELD, LAMBDA_FIELD)); private static final long serialVersionUID = 1L; private final Boolean ec2; private final Boolean ecr; private final Boolean lambda; private AutoEnable(BuilderImpl builder) { this.ec2 = builder.ec2; this.ecr = builder.ecr; this.lambda = builder.lambda; } /** *

* Represents whether Amazon EC2 scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @return Represents whether Amazon EC2 scans are automatically enabled for new members of your Amazon Inspector * organization. */ public final Boolean ec2() { return ec2; } /** *

* Represents whether Amazon ECR scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @return Represents whether Amazon ECR scans are automatically enabled for new members of your Amazon Inspector * organization. */ public final Boolean ecr() { return ecr; } /** *

* Represents whether AWS Lambda scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @return Represents whether AWS Lambda scans are automatically enabled for new members of your Amazon Inspector * organization. */ public final Boolean lambda() { return lambda; } @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 + Objects.hashCode(ec2()); hashCode = 31 * hashCode + Objects.hashCode(ecr()); hashCode = 31 * hashCode + Objects.hashCode(lambda()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AutoEnable)) { return false; } AutoEnable other = (AutoEnable) obj; return Objects.equals(ec2(), other.ec2()) && Objects.equals(ecr(), other.ecr()) && Objects.equals(lambda(), other.lambda()); } /** * 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("AutoEnable").add("Ec2", ec2()).add("Ecr", ecr()).add("Lambda", lambda()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ec2": return Optional.ofNullable(clazz.cast(ec2())); case "ecr": return Optional.ofNullable(clazz.cast(ecr())); case "lambda": return Optional.ofNullable(clazz.cast(lambda())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AutoEnable) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Represents whether Amazon EC2 scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @param ec2 * Represents whether Amazon EC2 scans are automatically enabled for new members of your Amazon Inspector * organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2(Boolean ec2); /** *

* Represents whether Amazon ECR scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @param ecr * Represents whether Amazon ECR scans are automatically enabled for new members of your Amazon Inspector * organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ecr(Boolean ecr); /** *

* Represents whether AWS Lambda scans are automatically enabled for new members of your Amazon Inspector * organization. *

* * @param lambda * Represents whether AWS Lambda scans are automatically enabled for new members of your Amazon Inspector * organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lambda(Boolean lambda); } static final class BuilderImpl implements Builder { private Boolean ec2; private Boolean ecr; private Boolean lambda; private BuilderImpl() { } private BuilderImpl(AutoEnable model) { ec2(model.ec2); ecr(model.ecr); lambda(model.lambda); } public final Boolean getEc2() { return ec2; } public final void setEc2(Boolean ec2) { this.ec2 = ec2; } @Override public final Builder ec2(Boolean ec2) { this.ec2 = ec2; return this; } public final Boolean getEcr() { return ecr; } public final void setEcr(Boolean ecr) { this.ecr = ecr; } @Override public final Builder ecr(Boolean ecr) { this.ecr = ecr; return this; } public final Boolean getLambda() { return lambda; } public final void setLambda(Boolean lambda) { this.lambda = lambda; } @Override public final Builder lambda(Boolean lambda) { this.lambda = lambda; return this; } @Override public AutoEnable build() { return new AutoEnable(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy