commonMain.aws.sdk.kotlin.services.kinesisvideo.model.ScheduleConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesisvideo-jvm Show documentation
Show all versions of kinesisvideo-jvm Show documentation
The AWS SDK for Kotlin client for Kinesis Video
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kinesisvideo.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* This API enables you to specify the duration that the camera, or local media file, should record onto the Edge Agent. The `ScheduleConfig` consists of the `ScheduleExpression` and the `DurationInMinutes` attributes.
*
* If the `ScheduleConfig` is not provided in the `RecorderConfig`, then the Edge Agent will always be set to recording mode.
*
* If the `ScheduleConfig` is not provided in the `UploaderConfig`, then the Edge Agent will upload at regular intervals (every 1 hour).
*/
public class ScheduleConfig private constructor(builder: Builder) {
/**
* The total duration to record the media. If the `ScheduleExpression` attribute is provided, then the `DurationInSeconds` attribute should also be specified.
*/
public val durationInSeconds: kotlin.Int = requireNotNull(builder.durationInSeconds) { "A non-null value must be provided for durationInSeconds" }
/**
* The Quartz cron expression that takes care of scheduling jobs to record from the camera, or local media file, onto the Edge Agent. If the `ScheduleExpression` is not provided for the `RecorderConfig`, then the Edge Agent will always be set to recording mode.
*
* For more information about Quartz, refer to the *Cron Trigger Tutorial*[](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) page to understand the valid expressions and its use.
*/
public val scheduleExpression: kotlin.String = requireNotNull(builder.scheduleExpression) { "A non-null value must be provided for scheduleExpression" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kinesisvideo.model.ScheduleConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ScheduleConfig(")
append("durationInSeconds=$durationInSeconds,")
append("scheduleExpression=$scheduleExpression")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = durationInSeconds
result = 31 * result + (scheduleExpression.hashCode())
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 ScheduleConfig
if (durationInSeconds != other.durationInSeconds) return false
if (scheduleExpression != other.scheduleExpression) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kinesisvideo.model.ScheduleConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The total duration to record the media. If the `ScheduleExpression` attribute is provided, then the `DurationInSeconds` attribute should also be specified.
*/
public var durationInSeconds: kotlin.Int? = null
/**
* The Quartz cron expression that takes care of scheduling jobs to record from the camera, or local media file, onto the Edge Agent. If the `ScheduleExpression` is not provided for the `RecorderConfig`, then the Edge Agent will always be set to recording mode.
*
* For more information about Quartz, refer to the *Cron Trigger Tutorial*[](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) page to understand the valid expressions and its use.
*/
public var scheduleExpression: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.kinesisvideo.model.ScheduleConfig) : this() {
this.durationInSeconds = x.durationInSeconds
this.scheduleExpression = x.scheduleExpression
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.kinesisvideo.model.ScheduleConfig = ScheduleConfig(this)
internal fun correctErrors(): Builder {
if (durationInSeconds == null) durationInSeconds = 0
if (scheduleExpression == null) scheduleExpression = ""
return this
}
}
}