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

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

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateMaintenanceWindowResponse extends SsmResponse implements
        ToCopyableBuilder {
    private static final SdkField WINDOW_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("WindowId").getter(getter(UpdateMaintenanceWindowResponse::windowId)).setter(setter(Builder::windowId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WindowId").build()).build();

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

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

    private static final SdkField START_DATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StartDate").getter(getter(UpdateMaintenanceWindowResponse::startDate))
            .setter(setter(Builder::startDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartDate").build()).build();

    private static final SdkField END_DATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EndDate").getter(getter(UpdateMaintenanceWindowResponse::endDate)).setter(setter(Builder::endDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndDate").build()).build();

    private static final SdkField SCHEDULE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Schedule").getter(getter(UpdateMaintenanceWindowResponse::schedule)).setter(setter(Builder::schedule))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Schedule").build()).build();

    private static final SdkField SCHEDULE_TIMEZONE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ScheduleTimezone").getter(getter(UpdateMaintenanceWindowResponse::scheduleTimezone))
            .setter(setter(Builder::scheduleTimezone))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduleTimezone").build()).build();

    private static final SdkField SCHEDULE_OFFSET_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("ScheduleOffset").getter(getter(UpdateMaintenanceWindowResponse::scheduleOffset))
            .setter(setter(Builder::scheduleOffset))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduleOffset").build()).build();

    private static final SdkField DURATION_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("Duration").getter(getter(UpdateMaintenanceWindowResponse::duration)).setter(setter(Builder::duration))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Duration").build()).build();

    private static final SdkField CUTOFF_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("Cutoff").getter(getter(UpdateMaintenanceWindowResponse::cutoff)).setter(setter(Builder::cutoff))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Cutoff").build()).build();

    private static final SdkField ALLOW_UNASSOCIATED_TARGETS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("AllowUnassociatedTargets").getter(getter(UpdateMaintenanceWindowResponse::allowUnassociatedTargets))
            .setter(setter(Builder::allowUnassociatedTargets))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowUnassociatedTargets").build())
            .build();

    private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("Enabled").getter(getter(UpdateMaintenanceWindowResponse::enabled)).setter(setter(Builder::enabled))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(WINDOW_ID_FIELD, NAME_FIELD,
            DESCRIPTION_FIELD, START_DATE_FIELD, END_DATE_FIELD, SCHEDULE_FIELD, SCHEDULE_TIMEZONE_FIELD, SCHEDULE_OFFSET_FIELD,
            DURATION_FIELD, CUTOFF_FIELD, ALLOW_UNASSOCIATED_TARGETS_FIELD, ENABLED_FIELD));

    private final String windowId;

    private final String name;

    private final String description;

    private final String startDate;

    private final String endDate;

    private final String schedule;

    private final String scheduleTimezone;

    private final Integer scheduleOffset;

    private final Integer duration;

    private final Integer cutoff;

    private final Boolean allowUnassociatedTargets;

    private final Boolean enabled;

    private UpdateMaintenanceWindowResponse(BuilderImpl builder) {
        super(builder);
        this.windowId = builder.windowId;
        this.name = builder.name;
        this.description = builder.description;
        this.startDate = builder.startDate;
        this.endDate = builder.endDate;
        this.schedule = builder.schedule;
        this.scheduleTimezone = builder.scheduleTimezone;
        this.scheduleOffset = builder.scheduleOffset;
        this.duration = builder.duration;
        this.cutoff = builder.cutoff;
        this.allowUnassociatedTargets = builder.allowUnassociatedTargets;
        this.enabled = builder.enabled;
    }

    /**
     * 

* The ID of the created maintenance window. *

* * @return The ID of the created maintenance window. */ public String windowId() { return windowId; } /** *

* The name of the maintenance window. *

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

* An optional description of the update. *

* * @return An optional description of the update. */ public String description() { return description; } /** *

* The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become active. * The maintenance window will not run before this specified time. *

* * @return The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * active. The maintenance window will not run before this specified time. */ public String startDate() { return startDate; } /** *

* The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become inactive. * The maintenance window will not run after this specified time. *

* * @return The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * inactive. The maintenance window will not run after this specified time. */ public String endDate() { return endDate; } /** *

* The schedule of the maintenance window in the form of a cron or rate expression. *

* * @return The schedule of the maintenance window in the form of a cron or rate expression. */ public String schedule() { return schedule; } /** *

* The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers * Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, * see the Time Zone Database on the IANA website. *

* * @return The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers * Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more * information, see the Time Zone Database on the IANA * website. */ public String scheduleTimezone() { return scheduleTimezone; } /** *

* The number of days to wait to run a maintenance window after the scheduled CRON expression date and time. *

* * @return The number of days to wait to run a maintenance window after the scheduled CRON expression date and time. */ public Integer scheduleOffset() { return scheduleOffset; } /** *

* The duration of the maintenance window in hours. *

* * @return The duration of the maintenance window in hours. */ public Integer duration() { return duration; } /** *

* The number of hours before the end of the maintenance window that Systems Manager stops scheduling new tasks for * execution. *

* * @return The number of hours before the end of the maintenance window that Systems Manager stops scheduling new * tasks for execution. */ public Integer cutoff() { return cutoff; } /** *

* Whether targets must be registered with the maintenance window before tasks can be defined for those targets. *

* * @return Whether targets must be registered with the maintenance window before tasks can be defined for those * targets. */ public Boolean allowUnassociatedTargets() { return allowUnassociatedTargets; } /** *

* Whether the maintenance window is enabled. *

* * @return Whether the maintenance window is enabled. */ public Boolean enabled() { return enabled; } @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(windowId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(startDate()); hashCode = 31 * hashCode + Objects.hashCode(endDate()); hashCode = 31 * hashCode + Objects.hashCode(schedule()); hashCode = 31 * hashCode + Objects.hashCode(scheduleTimezone()); hashCode = 31 * hashCode + Objects.hashCode(scheduleOffset()); hashCode = 31 * hashCode + Objects.hashCode(duration()); hashCode = 31 * hashCode + Objects.hashCode(cutoff()); hashCode = 31 * hashCode + Objects.hashCode(allowUnassociatedTargets()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); 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 UpdateMaintenanceWindowResponse)) { return false; } UpdateMaintenanceWindowResponse other = (UpdateMaintenanceWindowResponse) obj; return Objects.equals(windowId(), other.windowId()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(startDate(), other.startDate()) && Objects.equals(endDate(), other.endDate()) && Objects.equals(schedule(), other.schedule()) && Objects.equals(scheduleTimezone(), other.scheduleTimezone()) && Objects.equals(scheduleOffset(), other.scheduleOffset()) && Objects.equals(duration(), other.duration()) && Objects.equals(cutoff(), other.cutoff()) && Objects.equals(allowUnassociatedTargets(), other.allowUnassociatedTargets()) && Objects.equals(enabled(), other.enabled()); } /** * 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("UpdateMaintenanceWindowResponse").add("WindowId", windowId()).add("Name", name()) .add("Description", description() == null ? null : "*** Sensitive Data Redacted ***") .add("StartDate", startDate()).add("EndDate", endDate()).add("Schedule", schedule()) .add("ScheduleTimezone", scheduleTimezone()).add("ScheduleOffset", scheduleOffset()).add("Duration", duration()) .add("Cutoff", cutoff()).add("AllowUnassociatedTargets", allowUnassociatedTargets()).add("Enabled", enabled()) .build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "WindowId": return Optional.ofNullable(clazz.cast(windowId())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "StartDate": return Optional.ofNullable(clazz.cast(startDate())); case "EndDate": return Optional.ofNullable(clazz.cast(endDate())); case "Schedule": return Optional.ofNullable(clazz.cast(schedule())); case "ScheduleTimezone": return Optional.ofNullable(clazz.cast(scheduleTimezone())); case "ScheduleOffset": return Optional.ofNullable(clazz.cast(scheduleOffset())); case "Duration": return Optional.ofNullable(clazz.cast(duration())); case "Cutoff": return Optional.ofNullable(clazz.cast(cutoff())); case "AllowUnassociatedTargets": return Optional.ofNullable(clazz.cast(allowUnassociatedTargets())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateMaintenanceWindowResponse) 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 created maintenance window. *

* * @param windowId * The ID of the created maintenance window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder windowId(String windowId); /** *

* The name of the maintenance window. *

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

* An optional description of the update. *

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

* The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * active. The maintenance window will not run before this specified time. *

* * @param startDate * The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * active. The maintenance window will not run before this specified time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startDate(String startDate); /** *

* The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * inactive. The maintenance window will not run after this specified time. *

* * @param endDate * The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become * inactive. The maintenance window will not run after this specified time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endDate(String endDate); /** *

* The schedule of the maintenance window in the form of a cron or rate expression. *

* * @param schedule * The schedule of the maintenance window in the form of a cron or rate expression. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schedule(String schedule); /** *

* The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers * Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more * information, see the Time Zone Database on the IANA website. *

* * @param scheduleTimezone * The time zone that the scheduled maintenance window executions are based on, in Internet Assigned * Numbers Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For * more information, see the Time Zone Database on the IANA * website. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scheduleTimezone(String scheduleTimezone); /** *

* The number of days to wait to run a maintenance window after the scheduled CRON expression date and time. *

* * @param scheduleOffset * The number of days to wait to run a maintenance window after the scheduled CRON expression date and * time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scheduleOffset(Integer scheduleOffset); /** *

* The duration of the maintenance window in hours. *

* * @param duration * The duration of the maintenance window in hours. * @return Returns a reference to this object so that method calls can be chained together. */ Builder duration(Integer duration); /** *

* The number of hours before the end of the maintenance window that Systems Manager stops scheduling new tasks * for execution. *

* * @param cutoff * The number of hours before the end of the maintenance window that Systems Manager stops scheduling new * tasks for execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cutoff(Integer cutoff); /** *

* Whether targets must be registered with the maintenance window before tasks can be defined for those targets. *

* * @param allowUnassociatedTargets * Whether targets must be registered with the maintenance window before tasks can be defined for those * targets. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowUnassociatedTargets(Boolean allowUnassociatedTargets); /** *

* Whether the maintenance window is enabled. *

* * @param enabled * Whether the maintenance window is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); } static final class BuilderImpl extends SsmResponse.BuilderImpl implements Builder { private String windowId; private String name; private String description; private String startDate; private String endDate; private String schedule; private String scheduleTimezone; private Integer scheduleOffset; private Integer duration; private Integer cutoff; private Boolean allowUnassociatedTargets; private Boolean enabled; private BuilderImpl() { } private BuilderImpl(UpdateMaintenanceWindowResponse model) { super(model); windowId(model.windowId); name(model.name); description(model.description); startDate(model.startDate); endDate(model.endDate); schedule(model.schedule); scheduleTimezone(model.scheduleTimezone); scheduleOffset(model.scheduleOffset); duration(model.duration); cutoff(model.cutoff); allowUnassociatedTargets(model.allowUnassociatedTargets); enabled(model.enabled); } public final String getWindowId() { return windowId; } @Override public final Builder windowId(String windowId) { this.windowId = windowId; return this; } public final void setWindowId(String windowId) { this.windowId = windowId; } 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 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 String getStartDate() { return startDate; } @Override public final Builder startDate(String startDate) { this.startDate = startDate; return this; } public final void setStartDate(String startDate) { this.startDate = startDate; } public final String getEndDate() { return endDate; } @Override public final Builder endDate(String endDate) { this.endDate = endDate; return this; } public final void setEndDate(String endDate) { this.endDate = endDate; } public final String getSchedule() { return schedule; } @Override public final Builder schedule(String schedule) { this.schedule = schedule; return this; } public final void setSchedule(String schedule) { this.schedule = schedule; } public final String getScheduleTimezone() { return scheduleTimezone; } @Override public final Builder scheduleTimezone(String scheduleTimezone) { this.scheduleTimezone = scheduleTimezone; return this; } public final void setScheduleTimezone(String scheduleTimezone) { this.scheduleTimezone = scheduleTimezone; } public final Integer getScheduleOffset() { return scheduleOffset; } @Override public final Builder scheduleOffset(Integer scheduleOffset) { this.scheduleOffset = scheduleOffset; return this; } public final void setScheduleOffset(Integer scheduleOffset) { this.scheduleOffset = scheduleOffset; } public final Integer getDuration() { return duration; } @Override public final Builder duration(Integer duration) { this.duration = duration; return this; } public final void setDuration(Integer duration) { this.duration = duration; } public final Integer getCutoff() { return cutoff; } @Override public final Builder cutoff(Integer cutoff) { this.cutoff = cutoff; return this; } public final void setCutoff(Integer cutoff) { this.cutoff = cutoff; } public final Boolean getAllowUnassociatedTargets() { return allowUnassociatedTargets; } @Override public final Builder allowUnassociatedTargets(Boolean allowUnassociatedTargets) { this.allowUnassociatedTargets = allowUnassociatedTargets; return this; } public final void setAllowUnassociatedTargets(Boolean allowUnassociatedTargets) { this.allowUnassociatedTargets = allowUnassociatedTargets; } public final Boolean getEnabled() { return enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } @Override public UpdateMaintenanceWindowResponse build() { return new UpdateMaintenanceWindowResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy