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

software.amazon.awssdk.services.storagegateway.model.UpdateMaintenanceStartTimeRequest 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.storagegateway.model;

import java.beans.Transient;
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;

/**
 * 

* A JSON object containing the following fields: *

* */ @Generated("software.amazon.awssdk:codegen") public final class UpdateMaintenanceStartTimeRequest extends StorageGatewayRequest implements ToCopyableBuilder { private static final SdkField GATEWAY_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GatewayARN").getter(getter(UpdateMaintenanceStartTimeRequest::gatewayARN)) .setter(setter(Builder::gatewayARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GatewayARN").build()).build(); private static final SdkField HOUR_OF_DAY_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("HourOfDay").getter(getter(UpdateMaintenanceStartTimeRequest::hourOfDay)) .setter(setter(Builder::hourOfDay)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HourOfDay").build()).build(); private static final SdkField MINUTE_OF_HOUR_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MinuteOfHour").getter(getter(UpdateMaintenanceStartTimeRequest::minuteOfHour)) .setter(setter(Builder::minuteOfHour)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinuteOfHour").build()).build(); private static final SdkField DAY_OF_WEEK_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("DayOfWeek").getter(getter(UpdateMaintenanceStartTimeRequest::dayOfWeek)) .setter(setter(Builder::dayOfWeek)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DayOfWeek").build()).build(); private static final SdkField DAY_OF_MONTH_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("DayOfMonth").getter(getter(UpdateMaintenanceStartTimeRequest::dayOfMonth)) .setter(setter(Builder::dayOfMonth)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DayOfMonth").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(GATEWAY_ARN_FIELD, HOUR_OF_DAY_FIELD, MINUTE_OF_HOUR_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_MONTH_FIELD)); private final String gatewayARN; private final Integer hourOfDay; private final Integer minuteOfHour; private final Integer dayOfWeek; private final Integer dayOfMonth; private UpdateMaintenanceStartTimeRequest(BuilderImpl builder) { super(builder); this.gatewayARN = builder.gatewayARN; this.hourOfDay = builder.hourOfDay; this.minuteOfHour = builder.minuteOfHour; this.dayOfWeek = builder.dayOfWeek; this.dayOfMonth = builder.dayOfMonth; } /** * Returns the value of the GatewayARN property for this object. * * @return The value of the GatewayARN property for this object. */ public final String gatewayARN() { return gatewayARN; } /** *

* The hour component of the maintenance start time represented as hh, where hh is the hour (00 to * 23). The hour of the day is in the time zone of the gateway. *

* * @return The hour component of the maintenance start time represented as hh, where hh is the hour * (00 to 23). The hour of the day is in the time zone of the gateway. */ public final Integer hourOfDay() { return hourOfDay; } /** *

* The minute component of the maintenance start time represented as mm, where mm is the minute (00 to * 59). The minute of the hour is in the time zone of the gateway. *

* * @return The minute component of the maintenance start time represented as mm, where mm is the * minute (00 to 59). The minute of the hour is in the time zone of the gateway. */ public final Integer minuteOfHour() { return minuteOfHour; } /** *

* The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, * where 0 represents Sunday and 6 Saturday. *

* * @return The day of the week component of the maintenance start time week represented as an ordinal number from 0 * to 6, where 0 represents Sunday and 6 Saturday. */ public final Integer dayOfWeek() { return dayOfWeek; } /** *

* The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where * 1 represents the first day of the month and 28 represents the last day of the month. *

* * @return The day of the month component of the maintenance start time represented as an ordinal number from 1 to * 28, where 1 represents the first day of the month and 28 represents the last day of the month. */ public final Integer dayOfMonth() { return dayOfMonth; } @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(gatewayARN()); hashCode = 31 * hashCode + Objects.hashCode(hourOfDay()); hashCode = 31 * hashCode + Objects.hashCode(minuteOfHour()); hashCode = 31 * hashCode + Objects.hashCode(dayOfWeek()); hashCode = 31 * hashCode + Objects.hashCode(dayOfMonth()); 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 UpdateMaintenanceStartTimeRequest)) { return false; } UpdateMaintenanceStartTimeRequest other = (UpdateMaintenanceStartTimeRequest) obj; return Objects.equals(gatewayARN(), other.gatewayARN()) && Objects.equals(hourOfDay(), other.hourOfDay()) && Objects.equals(minuteOfHour(), other.minuteOfHour()) && Objects.equals(dayOfWeek(), other.dayOfWeek()) && Objects.equals(dayOfMonth(), other.dayOfMonth()); } /** * 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("UpdateMaintenanceStartTimeRequest").add("GatewayARN", gatewayARN()) .add("HourOfDay", hourOfDay()).add("MinuteOfHour", minuteOfHour()).add("DayOfWeek", dayOfWeek()) .add("DayOfMonth", dayOfMonth()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GatewayARN": return Optional.ofNullable(clazz.cast(gatewayARN())); case "HourOfDay": return Optional.ofNullable(clazz.cast(hourOfDay())); case "MinuteOfHour": return Optional.ofNullable(clazz.cast(minuteOfHour())); case "DayOfWeek": return Optional.ofNullable(clazz.cast(dayOfWeek())); case "DayOfMonth": return Optional.ofNullable(clazz.cast(dayOfMonth())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateMaintenanceStartTimeRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends StorageGatewayRequest.Builder, SdkPojo, CopyableBuilder { /** * Sets the value of the GatewayARN property for this object. * * @param gatewayARN * The new value for the GatewayARN property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder gatewayARN(String gatewayARN); /** *

* The hour component of the maintenance start time represented as hh, where hh is the hour (00 to * 23). The hour of the day is in the time zone of the gateway. *

* * @param hourOfDay * The hour component of the maintenance start time represented as hh, where hh is the hour * (00 to 23). The hour of the day is in the time zone of the gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hourOfDay(Integer hourOfDay); /** *

* The minute component of the maintenance start time represented as mm, where mm is the minute * (00 to 59). The minute of the hour is in the time zone of the gateway. *

* * @param minuteOfHour * The minute component of the maintenance start time represented as mm, where mm is the * minute (00 to 59). The minute of the hour is in the time zone of the gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minuteOfHour(Integer minuteOfHour); /** *

* The day of the week component of the maintenance start time week represented as an ordinal number from 0 to * 6, where 0 represents Sunday and 6 Saturday. *

* * @param dayOfWeek * The day of the week component of the maintenance start time week represented as an ordinal number from * 0 to 6, where 0 represents Sunday and 6 Saturday. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dayOfWeek(Integer dayOfWeek); /** *

* The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, * where 1 represents the first day of the month and 28 represents the last day of the month. *

* * @param dayOfMonth * The day of the month component of the maintenance start time represented as an ordinal number from 1 * to 28, where 1 represents the first day of the month and 28 represents the last day of the month. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dayOfMonth(Integer dayOfMonth); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends StorageGatewayRequest.BuilderImpl implements Builder { private String gatewayARN; private Integer hourOfDay; private Integer minuteOfHour; private Integer dayOfWeek; private Integer dayOfMonth; private BuilderImpl() { } private BuilderImpl(UpdateMaintenanceStartTimeRequest model) { super(model); gatewayARN(model.gatewayARN); hourOfDay(model.hourOfDay); minuteOfHour(model.minuteOfHour); dayOfWeek(model.dayOfWeek); dayOfMonth(model.dayOfMonth); } public final String getGatewayARN() { return gatewayARN; } public final void setGatewayARN(String gatewayARN) { this.gatewayARN = gatewayARN; } @Override @Transient public final Builder gatewayARN(String gatewayARN) { this.gatewayARN = gatewayARN; return this; } public final Integer getHourOfDay() { return hourOfDay; } public final void setHourOfDay(Integer hourOfDay) { this.hourOfDay = hourOfDay; } @Override @Transient public final Builder hourOfDay(Integer hourOfDay) { this.hourOfDay = hourOfDay; return this; } public final Integer getMinuteOfHour() { return minuteOfHour; } public final void setMinuteOfHour(Integer minuteOfHour) { this.minuteOfHour = minuteOfHour; } @Override @Transient public final Builder minuteOfHour(Integer minuteOfHour) { this.minuteOfHour = minuteOfHour; return this; } public final Integer getDayOfWeek() { return dayOfWeek; } public final void setDayOfWeek(Integer dayOfWeek) { this.dayOfWeek = dayOfWeek; } @Override @Transient public final Builder dayOfWeek(Integer dayOfWeek) { this.dayOfWeek = dayOfWeek; return this; } public final Integer getDayOfMonth() { return dayOfMonth; } public final void setDayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; } @Override @Transient public final Builder dayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; 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 UpdateMaintenanceStartTimeRequest build() { return new UpdateMaintenanceStartTimeRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy