
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 extends Builder> 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