commonMain.aws.sdk.kotlin.services.glue.model.Schedule.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A scheduling object using a `cron` statement to schedule an event.
*/
public class Schedule private constructor(builder: Builder) {
/**
* A `cron` expression used to specify the schedule (see [Time-Based Schedules for Jobs and Crawlers](https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html). For example, to run something every day at 12:15 UTC, you would specify: `cron(15 12 * * ? *)`.
*/
public val scheduleExpression: kotlin.String? = builder.scheduleExpression
/**
* The state of the schedule.
*/
public val state: aws.sdk.kotlin.services.glue.model.ScheduleState? = builder.state
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.Schedule = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Schedule(")
append("scheduleExpression=$scheduleExpression,")
append("state=$state")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = scheduleExpression?.hashCode() ?: 0
result = 31 * result + (state?.hashCode() ?: 0)
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 Schedule
if (scheduleExpression != other.scheduleExpression) return false
if (state != other.state) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.Schedule = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A `cron` expression used to specify the schedule (see [Time-Based Schedules for Jobs and Crawlers](https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html). For example, to run something every day at 12:15 UTC, you would specify: `cron(15 12 * * ? *)`.
*/
public var scheduleExpression: kotlin.String? = null
/**
* The state of the schedule.
*/
public var state: aws.sdk.kotlin.services.glue.model.ScheduleState? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.Schedule) : this() {
this.scheduleExpression = x.scheduleExpression
this.state = x.state
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.Schedule = Schedule(this)
internal fun correctErrors(): Builder {
return this
}
}
}