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

commonMain.aws.sdk.kotlin.services.backupgateway.model.PutMaintenanceStartTimeRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.37
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.backupgateway.model

import aws.smithy.kotlin.runtime.SdkDsl

public class PutMaintenanceStartTimeRequest private constructor(builder: Builder) {
    /**
     * The day of the month start maintenance on a gateway.
     *
     * Valid values range from `Sunday` to `Saturday`.
     */
    public val dayOfMonth: kotlin.Int? = builder.dayOfMonth
    /**
     * The day of the week to start maintenance on a gateway.
     */
    public val dayOfWeek: kotlin.Int? = builder.dayOfWeek
    /**
     * The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.
     */
    public val gatewayArn: kotlin.String = requireNotNull(builder.gatewayArn) { "A non-null value must be provided for gatewayArn" }
    /**
     * The hour of the day to start maintenance on a gateway.
     */
    public val hourOfDay: kotlin.Int = requireNotNull(builder.hourOfDay) { "A non-null value must be provided for hourOfDay" }
    /**
     * The minute of the hour to start maintenance on a gateway.
     */
    public val minuteOfHour: kotlin.Int = requireNotNull(builder.minuteOfHour) { "A non-null value must be provided for minuteOfHour" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.backupgateway.model.PutMaintenanceStartTimeRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("PutMaintenanceStartTimeRequest(")
        append("dayOfMonth=$dayOfMonth,")
        append("dayOfWeek=$dayOfWeek,")
        append("gatewayArn=$gatewayArn,")
        append("hourOfDay=$hourOfDay,")
        append("minuteOfHour=$minuteOfHour")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dayOfMonth ?: 0
        result = 31 * result + (dayOfWeek ?: 0)
        result = 31 * result + (gatewayArn.hashCode())
        result = 31 * result + (hourOfDay)
        result = 31 * result + (minuteOfHour)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as PutMaintenanceStartTimeRequest

        if (dayOfMonth != other.dayOfMonth) return false
        if (dayOfWeek != other.dayOfWeek) return false
        if (gatewayArn != other.gatewayArn) return false
        if (hourOfDay != other.hourOfDay) return false
        if (minuteOfHour != other.minuteOfHour) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.backupgateway.model.PutMaintenanceStartTimeRequest = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The day of the month start maintenance on a gateway.
         *
         * Valid values range from `Sunday` to `Saturday`.
         */
        public var dayOfMonth: kotlin.Int? = null
        /**
         * The day of the week to start maintenance on a gateway.
         */
        public var dayOfWeek: kotlin.Int? = null
        /**
         * The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.
         */
        public var gatewayArn: kotlin.String? = null
        /**
         * The hour of the day to start maintenance on a gateway.
         */
        public var hourOfDay: kotlin.Int? = null
        /**
         * The minute of the hour to start maintenance on a gateway.
         */
        public var minuteOfHour: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.backupgateway.model.PutMaintenanceStartTimeRequest) : this() {
            this.dayOfMonth = x.dayOfMonth
            this.dayOfWeek = x.dayOfWeek
            this.gatewayArn = x.gatewayArn
            this.hourOfDay = x.hourOfDay
            this.minuteOfHour = x.minuteOfHour
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.backupgateway.model.PutMaintenanceStartTimeRequest = PutMaintenanceStartTimeRequest(this)

        internal fun correctErrors(): Builder {
            if (gatewayArn == null) gatewayArn = ""
            if (hourOfDay == null) hourOfDay = 0
            if (minuteOfHour == null) minuteOfHour = 0
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy