commonMain.aws.sdk.kotlin.services.cloudwatchevents.model.PutRuleRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudwatchevents-jvm Show documentation
Show all versions of cloudwatchevents-jvm Show documentation
The AWS SDK for Kotlin client for CloudWatch Events
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudwatchevents.model
import aws.smithy.kotlin.runtime.SdkDsl
public class PutRuleRequest private constructor(builder: Builder) {
/**
* A description of the rule.
*/
public val description: kotlin.String? = builder.description
/**
* The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.
*/
public val eventBusName: kotlin.String? = builder.eventBusName
/**
* The event pattern. For more information, see [Events and Event Patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) in the *Amazon EventBridge User Guide*.
*/
public val eventPattern: kotlin.String? = builder.eventPattern
/**
* The name of the rule that you are creating or updating.
*/
public val name: kotlin.String? = builder.name
/**
* The Amazon Resource Name (ARN) of the IAM role associated with the rule.
*
* If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a `RoleArn` with proper permissions in the `Target` structure, instead of here in this parameter.
*/
public val roleArn: kotlin.String? = builder.roleArn
/**
* The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
*/
public val scheduleExpression: kotlin.String? = builder.scheduleExpression
/**
* Indicates whether the rule is enabled or disabled.
*/
public val state: aws.sdk.kotlin.services.cloudwatchevents.model.RuleState? = builder.state
/**
* The list of key-value pairs to associate with the rule.
*/
public val tags: List? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatchevents.model.PutRuleRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PutRuleRequest(")
append("description=$description,")
append("eventBusName=$eventBusName,")
append("eventPattern=$eventPattern,")
append("name=$name,")
append("roleArn=$roleArn,")
append("scheduleExpression=$scheduleExpression,")
append("state=$state,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (eventBusName?.hashCode() ?: 0)
result = 31 * result + (eventPattern?.hashCode() ?: 0)
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + (roleArn?.hashCode() ?: 0)
result = 31 * result + (scheduleExpression?.hashCode() ?: 0)
result = 31 * result + (state?.hashCode() ?: 0)
result = 31 * result + (tags?.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 PutRuleRequest
if (description != other.description) return false
if (eventBusName != other.eventBusName) return false
if (eventPattern != other.eventPattern) return false
if (name != other.name) return false
if (roleArn != other.roleArn) return false
if (scheduleExpression != other.scheduleExpression) return false
if (state != other.state) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatchevents.model.PutRuleRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A description of the rule.
*/
public var description: kotlin.String? = null
/**
* The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.
*/
public var eventBusName: kotlin.String? = null
/**
* The event pattern. For more information, see [Events and Event Patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) in the *Amazon EventBridge User Guide*.
*/
public var eventPattern: kotlin.String? = null
/**
* The name of the rule that you are creating or updating.
*/
public var name: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the IAM role associated with the rule.
*
* If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a `RoleArn` with proper permissions in the `Target` structure, instead of here in this parameter.
*/
public var roleArn: kotlin.String? = null
/**
* The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
*/
public var scheduleExpression: kotlin.String? = null
/**
* Indicates whether the rule is enabled or disabled.
*/
public var state: aws.sdk.kotlin.services.cloudwatchevents.model.RuleState? = null
/**
* The list of key-value pairs to associate with the rule.
*/
public var tags: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudwatchevents.model.PutRuleRequest) : this() {
this.description = x.description
this.eventBusName = x.eventBusName
this.eventPattern = x.eventPattern
this.name = x.name
this.roleArn = x.roleArn
this.scheduleExpression = x.scheduleExpression
this.state = x.state
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudwatchevents.model.PutRuleRequest = PutRuleRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}