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

software.amazon.awssdk.services.ssm.model.UpdatePatchBaselineResponse 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.ssm.model;

import java.time.Instant;
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.core.util.SdkAutoConstructList;
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 UpdatePatchBaselineResponse extends SsmResponse implements
        ToCopyableBuilder {
    private static final SdkField BASELINE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("BaselineId").getter(getter(UpdatePatchBaselineResponse::baselineId)).setter(setter(Builder::baselineId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaselineId").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(UpdatePatchBaselineResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();

    private static final SdkField OPERATING_SYSTEM_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("OperatingSystem").getter(getter(UpdatePatchBaselineResponse::operatingSystemAsString))
            .setter(setter(Builder::operatingSystem))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OperatingSystem").build()).build();

    private static final SdkField GLOBAL_FILTERS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("GlobalFilters")
            .getter(getter(UpdatePatchBaselineResponse::globalFilters)).setter(setter(Builder::globalFilters))
            .constructor(PatchFilterGroup::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalFilters").build()).build();

    private static final SdkField APPROVAL_RULES_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ApprovalRules")
            .getter(getter(UpdatePatchBaselineResponse::approvalRules)).setter(setter(Builder::approvalRules))
            .constructor(PatchRuleGroup::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApprovalRules").build()).build();

    private static final SdkField> APPROVED_PATCHES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ApprovedPatches")
            .getter(getter(UpdatePatchBaselineResponse::approvedPatches))
            .setter(setter(Builder::approvedPatches))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApprovedPatches").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField APPROVED_PATCHES_COMPLIANCE_LEVEL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("ApprovedPatchesComplianceLevel")
            .getter(getter(UpdatePatchBaselineResponse::approvedPatchesComplianceLevelAsString))
            .setter(setter(Builder::approvedPatchesComplianceLevel))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApprovedPatchesComplianceLevel")
                    .build()).build();

    private static final SdkField APPROVED_PATCHES_ENABLE_NON_SECURITY_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("ApprovedPatchesEnableNonSecurity")
            .getter(getter(UpdatePatchBaselineResponse::approvedPatchesEnableNonSecurity))
            .setter(setter(Builder::approvedPatchesEnableNonSecurity))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApprovedPatchesEnableNonSecurity")
                    .build()).build();

    private static final SdkField> REJECTED_PATCHES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("RejectedPatches")
            .getter(getter(UpdatePatchBaselineResponse::rejectedPatches))
            .setter(setter(Builder::rejectedPatches))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RejectedPatches").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField REJECTED_PATCHES_ACTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RejectedPatchesAction").getter(getter(UpdatePatchBaselineResponse::rejectedPatchesActionAsString))
            .setter(setter(Builder::rejectedPatchesAction))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RejectedPatchesAction").build())
            .build();

    private static final SdkField CREATED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CreatedDate").getter(getter(UpdatePatchBaselineResponse::createdDate))
            .setter(setter(Builder::createdDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedDate").build()).build();

    private static final SdkField MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("ModifiedDate").getter(getter(UpdatePatchBaselineResponse::modifiedDate))
            .setter(setter(Builder::modifiedDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModifiedDate").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(UpdatePatchBaselineResponse::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField> SOURCES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Sources")
            .getter(getter(UpdatePatchBaselineResponse::sources))
            .setter(setter(Builder::sources))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Sources").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(PatchSource::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASELINE_ID_FIELD, NAME_FIELD,
            OPERATING_SYSTEM_FIELD, GLOBAL_FILTERS_FIELD, APPROVAL_RULES_FIELD, APPROVED_PATCHES_FIELD,
            APPROVED_PATCHES_COMPLIANCE_LEVEL_FIELD, APPROVED_PATCHES_ENABLE_NON_SECURITY_FIELD, REJECTED_PATCHES_FIELD,
            REJECTED_PATCHES_ACTION_FIELD, CREATED_DATE_FIELD, MODIFIED_DATE_FIELD, DESCRIPTION_FIELD, SOURCES_FIELD));

    private final String baselineId;

    private final String name;

    private final String operatingSystem;

    private final PatchFilterGroup globalFilters;

    private final PatchRuleGroup approvalRules;

    private final List approvedPatches;

    private final String approvedPatchesComplianceLevel;

    private final Boolean approvedPatchesEnableNonSecurity;

    private final List rejectedPatches;

    private final String rejectedPatchesAction;

    private final Instant createdDate;

    private final Instant modifiedDate;

    private final String description;

    private final List sources;

    private UpdatePatchBaselineResponse(BuilderImpl builder) {
        super(builder);
        this.baselineId = builder.baselineId;
        this.name = builder.name;
        this.operatingSystem = builder.operatingSystem;
        this.globalFilters = builder.globalFilters;
        this.approvalRules = builder.approvalRules;
        this.approvedPatches = builder.approvedPatches;
        this.approvedPatchesComplianceLevel = builder.approvedPatchesComplianceLevel;
        this.approvedPatchesEnableNonSecurity = builder.approvedPatchesEnableNonSecurity;
        this.rejectedPatches = builder.rejectedPatches;
        this.rejectedPatchesAction = builder.rejectedPatchesAction;
        this.createdDate = builder.createdDate;
        this.modifiedDate = builder.modifiedDate;
        this.description = builder.description;
        this.sources = builder.sources;
    }

    /**
     * 

* The ID of the deleted patch baseline. *

* * @return The ID of the deleted patch baseline. */ public String baselineId() { return baselineId; } /** *

* The name of the patch baseline. *

* * @return The name of the patch baseline. */ public String name() { return name; } /** *

* The operating system rule used by the updated patch baseline. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #operatingSystem} * will return {@link OperatingSystem#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #operatingSystemAsString}. *

* * @return The operating system rule used by the updated patch baseline. * @see OperatingSystem */ public OperatingSystem operatingSystem() { return OperatingSystem.fromValue(operatingSystem); } /** *

* The operating system rule used by the updated patch baseline. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #operatingSystem} * will return {@link OperatingSystem#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #operatingSystemAsString}. *

* * @return The operating system rule used by the updated patch baseline. * @see OperatingSystem */ public String operatingSystemAsString() { return operatingSystem; } /** *

* A set of global filters used to exclude patches from the baseline. *

* * @return A set of global filters used to exclude patches from the baseline. */ public PatchFilterGroup globalFilters() { return globalFilters; } /** *

* A set of rules used to include patches in the baseline. *

* * @return A set of rules used to include patches in the baseline. */ public PatchRuleGroup approvalRules() { return approvalRules; } /** * Returns true if the ApprovedPatches property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public boolean hasApprovedPatches() { return approvedPatches != null && !(approvedPatches instanceof SdkAutoConstructList); } /** *

* A list of explicitly approved patches for the baseline. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasApprovedPatches()} to see if a value was sent in this field. *

* * @return A list of explicitly approved patches for the baseline. */ public List approvedPatches() { return approvedPatches; } /** *

* The compliance severity level assigned to the patch baseline after the update completed. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #approvedPatchesComplianceLevel} will return {@link PatchComplianceLevel#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #approvedPatchesComplianceLevelAsString}. *

* * @return The compliance severity level assigned to the patch baseline after the update completed. * @see PatchComplianceLevel */ public PatchComplianceLevel approvedPatchesComplianceLevel() { return PatchComplianceLevel.fromValue(approvedPatchesComplianceLevel); } /** *

* The compliance severity level assigned to the patch baseline after the update completed. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #approvedPatchesComplianceLevel} will return {@link PatchComplianceLevel#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #approvedPatchesComplianceLevelAsString}. *

* * @return The compliance severity level assigned to the patch baseline after the update completed. * @see PatchComplianceLevel */ public String approvedPatchesComplianceLevelAsString() { return approvedPatchesComplianceLevel; } /** *

* Indicates whether the list of approved patches includes non-security updates that should be applied to the * instances. The default value is 'false'. Applies to Linux instances only. *

* * @return Indicates whether the list of approved patches includes non-security updates that should be applied to * the instances. The default value is 'false'. Applies to Linux instances only. */ public Boolean approvedPatchesEnableNonSecurity() { return approvedPatchesEnableNonSecurity; } /** * Returns true if the RejectedPatches property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public boolean hasRejectedPatches() { return rejectedPatches != null && !(rejectedPatches instanceof SdkAutoConstructList); } /** *

* A list of explicitly rejected patches for the baseline. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasRejectedPatches()} to see if a value was sent in this field. *

* * @return A list of explicitly rejected patches for the baseline. */ public List rejectedPatches() { return rejectedPatches; } /** *

* The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only if it * is a dependency of another package, or blocked entirely along with packages that include it as a dependency. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #rejectedPatchesAction} will return {@link PatchAction#UNKNOWN_TO_SDK_VERSION}. The raw value returned by * the service is available from {@link #rejectedPatchesActionAsString}. *

* * @return The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only * if it is a dependency of another package, or blocked entirely along with packages that include it as a * dependency. * @see PatchAction */ public PatchAction rejectedPatchesAction() { return PatchAction.fromValue(rejectedPatchesAction); } /** *

* The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only if it * is a dependency of another package, or blocked entirely along with packages that include it as a dependency. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #rejectedPatchesAction} will return {@link PatchAction#UNKNOWN_TO_SDK_VERSION}. The raw value returned by * the service is available from {@link #rejectedPatchesActionAsString}. *

* * @return The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only * if it is a dependency of another package, or blocked entirely along with packages that include it as a * dependency. * @see PatchAction */ public String rejectedPatchesActionAsString() { return rejectedPatchesAction; } /** *

* The date when the patch baseline was created. *

* * @return The date when the patch baseline was created. */ public Instant createdDate() { return createdDate; } /** *

* The date when the patch baseline was last modified. *

* * @return The date when the patch baseline was last modified. */ public Instant modifiedDate() { return modifiedDate; } /** *

* A description of the Patch Baseline. *

* * @return A description of the Patch Baseline. */ public String description() { return description; } /** * Returns true if the Sources property was specified by the sender (it may be empty), or false if the sender did * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasSources() { return sources != null && !(sources instanceof SdkAutoConstructList); } /** *

* Information about the patches to use to update the instances, including target operating systems and source * repositories. Applies to Linux instances only. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasSources()} to see if a value was sent in this field. *

* * @return Information about the patches to use to update the instances, including target operating systems and * source repositories. Applies to Linux instances only. */ public List sources() { return sources; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(baselineId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(operatingSystemAsString()); hashCode = 31 * hashCode + Objects.hashCode(globalFilters()); hashCode = 31 * hashCode + Objects.hashCode(approvalRules()); hashCode = 31 * hashCode + Objects.hashCode(approvedPatches()); hashCode = 31 * hashCode + Objects.hashCode(approvedPatchesComplianceLevelAsString()); hashCode = 31 * hashCode + Objects.hashCode(approvedPatchesEnableNonSecurity()); hashCode = 31 * hashCode + Objects.hashCode(rejectedPatches()); hashCode = 31 * hashCode + Objects.hashCode(rejectedPatchesActionAsString()); hashCode = 31 * hashCode + Objects.hashCode(createdDate()); hashCode = 31 * hashCode + Objects.hashCode(modifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(sources()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdatePatchBaselineResponse)) { return false; } UpdatePatchBaselineResponse other = (UpdatePatchBaselineResponse) obj; return Objects.equals(baselineId(), other.baselineId()) && Objects.equals(name(), other.name()) && Objects.equals(operatingSystemAsString(), other.operatingSystemAsString()) && Objects.equals(globalFilters(), other.globalFilters()) && Objects.equals(approvalRules(), other.approvalRules()) && Objects.equals(approvedPatches(), other.approvedPatches()) && Objects.equals(approvedPatchesComplianceLevelAsString(), other.approvedPatchesComplianceLevelAsString()) && Objects.equals(approvedPatchesEnableNonSecurity(), other.approvedPatchesEnableNonSecurity()) && Objects.equals(rejectedPatches(), other.rejectedPatches()) && Objects.equals(rejectedPatchesActionAsString(), other.rejectedPatchesActionAsString()) && Objects.equals(createdDate(), other.createdDate()) && Objects.equals(modifiedDate(), other.modifiedDate()) && Objects.equals(description(), other.description()) && Objects.equals(sources(), other.sources()); } /** * 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("UpdatePatchBaselineResponse").add("BaselineId", baselineId()).add("Name", name()) .add("OperatingSystem", operatingSystemAsString()).add("GlobalFilters", globalFilters()) .add("ApprovalRules", approvalRules()).add("ApprovedPatches", approvedPatches()) .add("ApprovedPatchesComplianceLevel", approvedPatchesComplianceLevelAsString()) .add("ApprovedPatchesEnableNonSecurity", approvedPatchesEnableNonSecurity()) .add("RejectedPatches", rejectedPatches()).add("RejectedPatchesAction", rejectedPatchesActionAsString()) .add("CreatedDate", createdDate()).add("ModifiedDate", modifiedDate()).add("Description", description()) .add("Sources", sources()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "BaselineId": return Optional.ofNullable(clazz.cast(baselineId())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "OperatingSystem": return Optional.ofNullable(clazz.cast(operatingSystemAsString())); case "GlobalFilters": return Optional.ofNullable(clazz.cast(globalFilters())); case "ApprovalRules": return Optional.ofNullable(clazz.cast(approvalRules())); case "ApprovedPatches": return Optional.ofNullable(clazz.cast(approvedPatches())); case "ApprovedPatchesComplianceLevel": return Optional.ofNullable(clazz.cast(approvedPatchesComplianceLevelAsString())); case "ApprovedPatchesEnableNonSecurity": return Optional.ofNullable(clazz.cast(approvedPatchesEnableNonSecurity())); case "RejectedPatches": return Optional.ofNullable(clazz.cast(rejectedPatches())); case "RejectedPatchesAction": return Optional.ofNullable(clazz.cast(rejectedPatchesActionAsString())); case "CreatedDate": return Optional.ofNullable(clazz.cast(createdDate())); case "ModifiedDate": return Optional.ofNullable(clazz.cast(modifiedDate())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Sources": return Optional.ofNullable(clazz.cast(sources())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdatePatchBaselineResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SsmResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the deleted patch baseline. *

* * @param baselineId * The ID of the deleted patch baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder baselineId(String baselineId); /** *

* The name of the patch baseline. *

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

* The operating system rule used by the updated patch baseline. *

* * @param operatingSystem * The operating system rule used by the updated patch baseline. * @see OperatingSystem * @return Returns a reference to this object so that method calls can be chained together. * @see OperatingSystem */ Builder operatingSystem(String operatingSystem); /** *

* The operating system rule used by the updated patch baseline. *

* * @param operatingSystem * The operating system rule used by the updated patch baseline. * @see OperatingSystem * @return Returns a reference to this object so that method calls can be chained together. * @see OperatingSystem */ Builder operatingSystem(OperatingSystem operatingSystem); /** *

* A set of global filters used to exclude patches from the baseline. *

* * @param globalFilters * A set of global filters used to exclude patches from the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalFilters(PatchFilterGroup globalFilters); /** *

* A set of global filters used to exclude patches from the baseline. *

* This is a convenience that creates an instance of the {@link PatchFilterGroup.Builder} avoiding the need to * create one manually via {@link PatchFilterGroup#builder()}. * * When the {@link Consumer} completes, {@link PatchFilterGroup.Builder#build()} is called immediately and its * result is passed to {@link #globalFilters(PatchFilterGroup)}. * * @param globalFilters * a consumer that will call methods on {@link PatchFilterGroup.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #globalFilters(PatchFilterGroup) */ default Builder globalFilters(Consumer globalFilters) { return globalFilters(PatchFilterGroup.builder().applyMutation(globalFilters).build()); } /** *

* A set of rules used to include patches in the baseline. *

* * @param approvalRules * A set of rules used to include patches in the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder approvalRules(PatchRuleGroup approvalRules); /** *

* A set of rules used to include patches in the baseline. *

* This is a convenience that creates an instance of the {@link PatchRuleGroup.Builder} avoiding the need to * create one manually via {@link PatchRuleGroup#builder()}. * * When the {@link Consumer} completes, {@link PatchRuleGroup.Builder#build()} is called immediately and its * result is passed to {@link #approvalRules(PatchRuleGroup)}. * * @param approvalRules * a consumer that will call methods on {@link PatchRuleGroup.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #approvalRules(PatchRuleGroup) */ default Builder approvalRules(Consumer approvalRules) { return approvalRules(PatchRuleGroup.builder().applyMutation(approvalRules).build()); } /** *

* A list of explicitly approved patches for the baseline. *

* * @param approvedPatches * A list of explicitly approved patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder approvedPatches(Collection approvedPatches); /** *

* A list of explicitly approved patches for the baseline. *

* * @param approvedPatches * A list of explicitly approved patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder approvedPatches(String... approvedPatches); /** *

* The compliance severity level assigned to the patch baseline after the update completed. *

* * @param approvedPatchesComplianceLevel * The compliance severity level assigned to the patch baseline after the update completed. * @see PatchComplianceLevel * @return Returns a reference to this object so that method calls can be chained together. * @see PatchComplianceLevel */ Builder approvedPatchesComplianceLevel(String approvedPatchesComplianceLevel); /** *

* The compliance severity level assigned to the patch baseline after the update completed. *

* * @param approvedPatchesComplianceLevel * The compliance severity level assigned to the patch baseline after the update completed. * @see PatchComplianceLevel * @return Returns a reference to this object so that method calls can be chained together. * @see PatchComplianceLevel */ Builder approvedPatchesComplianceLevel(PatchComplianceLevel approvedPatchesComplianceLevel); /** *

* Indicates whether the list of approved patches includes non-security updates that should be applied to the * instances. The default value is 'false'. Applies to Linux instances only. *

* * @param approvedPatchesEnableNonSecurity * Indicates whether the list of approved patches includes non-security updates that should be applied to * the instances. The default value is 'false'. Applies to Linux instances only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder approvedPatchesEnableNonSecurity(Boolean approvedPatchesEnableNonSecurity); /** *

* A list of explicitly rejected patches for the baseline. *

* * @param rejectedPatches * A list of explicitly rejected patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rejectedPatches(Collection rejectedPatches); /** *

* A list of explicitly rejected patches for the baseline. *

* * @param rejectedPatches * A list of explicitly rejected patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rejectedPatches(String... rejectedPatches); /** *

* The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only if * it is a dependency of another package, or blocked entirely along with packages that include it as a * dependency. *

* * @param rejectedPatchesAction * The action specified to take on patches included in the RejectedPatches list. A patch can be allowed * only if it is a dependency of another package, or blocked entirely along with packages that include it * as a dependency. * @see PatchAction * @return Returns a reference to this object so that method calls can be chained together. * @see PatchAction */ Builder rejectedPatchesAction(String rejectedPatchesAction); /** *

* The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only if * it is a dependency of another package, or blocked entirely along with packages that include it as a * dependency. *

* * @param rejectedPatchesAction * The action specified to take on patches included in the RejectedPatches list. A patch can be allowed * only if it is a dependency of another package, or blocked entirely along with packages that include it * as a dependency. * @see PatchAction * @return Returns a reference to this object so that method calls can be chained together. * @see PatchAction */ Builder rejectedPatchesAction(PatchAction rejectedPatchesAction); /** *

* The date when the patch baseline was created. *

* * @param createdDate * The date when the patch baseline was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdDate(Instant createdDate); /** *

* The date when the patch baseline was last modified. *

* * @param modifiedDate * The date when the patch baseline was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modifiedDate(Instant modifiedDate); /** *

* A description of the Patch Baseline. *

* * @param description * A description of the Patch Baseline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* Information about the patches to use to update the instances, including target operating systems and source * repositories. Applies to Linux instances only. *

* * @param sources * Information about the patches to use to update the instances, including target operating systems and * source repositories. Applies to Linux instances only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sources(Collection sources); /** *

* Information about the patches to use to update the instances, including target operating systems and source * repositories. Applies to Linux instances only. *

* * @param sources * Information about the patches to use to update the instances, including target operating systems and * source repositories. Applies to Linux instances only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sources(PatchSource... sources); /** *

* Information about the patches to use to update the instances, including target operating systems and source * repositories. Applies to Linux instances only. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #sources(List)}. * * @param sources * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sources(List) */ Builder sources(Consumer... sources); } static final class BuilderImpl extends SsmResponse.BuilderImpl implements Builder { private String baselineId; private String name; private String operatingSystem; private PatchFilterGroup globalFilters; private PatchRuleGroup approvalRules; private List approvedPatches = DefaultSdkAutoConstructList.getInstance(); private String approvedPatchesComplianceLevel; private Boolean approvedPatchesEnableNonSecurity; private List rejectedPatches = DefaultSdkAutoConstructList.getInstance(); private String rejectedPatchesAction; private Instant createdDate; private Instant modifiedDate; private String description; private List sources = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(UpdatePatchBaselineResponse model) { super(model); baselineId(model.baselineId); name(model.name); operatingSystem(model.operatingSystem); globalFilters(model.globalFilters); approvalRules(model.approvalRules); approvedPatches(model.approvedPatches); approvedPatchesComplianceLevel(model.approvedPatchesComplianceLevel); approvedPatchesEnableNonSecurity(model.approvedPatchesEnableNonSecurity); rejectedPatches(model.rejectedPatches); rejectedPatchesAction(model.rejectedPatchesAction); createdDate(model.createdDate); modifiedDate(model.modifiedDate); description(model.description); sources(model.sources); } public final String getBaselineId() { return baselineId; } @Override public final Builder baselineId(String baselineId) { this.baselineId = baselineId; return this; } public final void setBaselineId(String baselineId) { this.baselineId = baselineId; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getOperatingSystem() { return operatingSystem; } @Override public final Builder operatingSystem(String operatingSystem) { this.operatingSystem = operatingSystem; return this; } @Override public final Builder operatingSystem(OperatingSystem operatingSystem) { this.operatingSystem(operatingSystem == null ? null : operatingSystem.toString()); return this; } public final void setOperatingSystem(String operatingSystem) { this.operatingSystem = operatingSystem; } public final PatchFilterGroup.Builder getGlobalFilters() { return globalFilters != null ? globalFilters.toBuilder() : null; } @Override public final Builder globalFilters(PatchFilterGroup globalFilters) { this.globalFilters = globalFilters; return this; } public final void setGlobalFilters(PatchFilterGroup.BuilderImpl globalFilters) { this.globalFilters = globalFilters != null ? globalFilters.build() : null; } public final PatchRuleGroup.Builder getApprovalRules() { return approvalRules != null ? approvalRules.toBuilder() : null; } @Override public final Builder approvalRules(PatchRuleGroup approvalRules) { this.approvalRules = approvalRules; return this; } public final void setApprovalRules(PatchRuleGroup.BuilderImpl approvalRules) { this.approvalRules = approvalRules != null ? approvalRules.build() : null; } public final Collection getApprovedPatches() { return approvedPatches; } @Override public final Builder approvedPatches(Collection approvedPatches) { this.approvedPatches = PatchIdListCopier.copy(approvedPatches); return this; } @Override @SafeVarargs public final Builder approvedPatches(String... approvedPatches) { approvedPatches(Arrays.asList(approvedPatches)); return this; } public final void setApprovedPatches(Collection approvedPatches) { this.approvedPatches = PatchIdListCopier.copy(approvedPatches); } public final String getApprovedPatchesComplianceLevel() { return approvedPatchesComplianceLevel; } @Override public final Builder approvedPatchesComplianceLevel(String approvedPatchesComplianceLevel) { this.approvedPatchesComplianceLevel = approvedPatchesComplianceLevel; return this; } @Override public final Builder approvedPatchesComplianceLevel(PatchComplianceLevel approvedPatchesComplianceLevel) { this.approvedPatchesComplianceLevel(approvedPatchesComplianceLevel == null ? null : approvedPatchesComplianceLevel .toString()); return this; } public final void setApprovedPatchesComplianceLevel(String approvedPatchesComplianceLevel) { this.approvedPatchesComplianceLevel = approvedPatchesComplianceLevel; } public final Boolean getApprovedPatchesEnableNonSecurity() { return approvedPatchesEnableNonSecurity; } @Override public final Builder approvedPatchesEnableNonSecurity(Boolean approvedPatchesEnableNonSecurity) { this.approvedPatchesEnableNonSecurity = approvedPatchesEnableNonSecurity; return this; } public final void setApprovedPatchesEnableNonSecurity(Boolean approvedPatchesEnableNonSecurity) { this.approvedPatchesEnableNonSecurity = approvedPatchesEnableNonSecurity; } public final Collection getRejectedPatches() { return rejectedPatches; } @Override public final Builder rejectedPatches(Collection rejectedPatches) { this.rejectedPatches = PatchIdListCopier.copy(rejectedPatches); return this; } @Override @SafeVarargs public final Builder rejectedPatches(String... rejectedPatches) { rejectedPatches(Arrays.asList(rejectedPatches)); return this; } public final void setRejectedPatches(Collection rejectedPatches) { this.rejectedPatches = PatchIdListCopier.copy(rejectedPatches); } public final String getRejectedPatchesAction() { return rejectedPatchesAction; } @Override public final Builder rejectedPatchesAction(String rejectedPatchesAction) { this.rejectedPatchesAction = rejectedPatchesAction; return this; } @Override public final Builder rejectedPatchesAction(PatchAction rejectedPatchesAction) { this.rejectedPatchesAction(rejectedPatchesAction == null ? null : rejectedPatchesAction.toString()); return this; } public final void setRejectedPatchesAction(String rejectedPatchesAction) { this.rejectedPatchesAction = rejectedPatchesAction; } public final Instant getCreatedDate() { return createdDate; } @Override public final Builder createdDate(Instant createdDate) { this.createdDate = createdDate; return this; } public final void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public final Instant getModifiedDate() { return modifiedDate; } @Override public final Builder modifiedDate(Instant modifiedDate) { this.modifiedDate = modifiedDate; return this; } public final void setModifiedDate(Instant modifiedDate) { this.modifiedDate = modifiedDate; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final Collection getSources() { return sources != null ? sources.stream().map(PatchSource::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder sources(Collection sources) { this.sources = PatchSourceListCopier.copy(sources); return this; } @Override @SafeVarargs public final Builder sources(PatchSource... sources) { sources(Arrays.asList(sources)); return this; } @Override @SafeVarargs public final Builder sources(Consumer... sources) { sources(Stream.of(sources).map(c -> PatchSource.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setSources(Collection sources) { this.sources = PatchSourceListCopier.copyFromBuilder(sources); } @Override public UpdatePatchBaselineResponse build() { return new UpdatePatchBaselineResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy