commonMain.aws.sdk.kotlin.services.shield.model.Contributor.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.shield.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A contributor to the attack and their contribution.
*/
public class Contributor private constructor(builder: Builder) {
/**
* The name of the contributor. The type of name that you'll find here depends on the `AttackPropertyIdentifier` setting in the `AttackProperty` where this contributor is defined. For example, if the `AttackPropertyIdentifier` is `SOURCE_COUNTRY`, the `Name` could be `United States`.
*/
public val name: kotlin.String? = builder.name
/**
* The contribution of this contributor expressed in Protection units. For example `10,000`.
*/
public val value: kotlin.Long = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.shield.model.Contributor = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Contributor(")
append("name=$name,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name?.hashCode() ?: 0
result = 31 * result + (value.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 Contributor
if (name != other.name) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.shield.model.Contributor = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the contributor. The type of name that you'll find here depends on the `AttackPropertyIdentifier` setting in the `AttackProperty` where this contributor is defined. For example, if the `AttackPropertyIdentifier` is `SOURCE_COUNTRY`, the `Name` could be `United States`.
*/
public var name: kotlin.String? = null
/**
* The contribution of this contributor expressed in Protection units. For example `10,000`.
*/
public var value: kotlin.Long = 0L
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.shield.model.Contributor) : this() {
this.name = x.name
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.shield.model.Contributor = Contributor(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy