commonMain.aws.sdk.kotlin.services.budgets.model.IamActionDefinition.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of budgets-jvm Show documentation
Show all versions of budgets-jvm Show documentation
The AWS SDK for Kotlin client for Budgets
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.budgets.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The Identity and Access Management (IAM) action definition details.
*/
public class IamActionDefinition private constructor(builder: Builder) {
/**
* A list of groups to be attached. There must be at least one group.
*/
public val groups: List? = builder.groups
/**
* The Amazon Resource Name (ARN) of the policy to be attached.
*/
public val policyArn: kotlin.String = requireNotNull(builder.policyArn) { "A non-null value must be provided for policyArn" }
/**
* A list of roles to be attached. There must be at least one role.
*/
public val roles: List? = builder.roles
/**
* A list of users to be attached. There must be at least one user.
*/
public val users: List? = builder.users
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.budgets.model.IamActionDefinition = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("IamActionDefinition(")
append("groups=$groups,")
append("policyArn=$policyArn,")
append("roles=$roles,")
append("users=$users")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = groups?.hashCode() ?: 0
result = 31 * result + (policyArn.hashCode())
result = 31 * result + (roles?.hashCode() ?: 0)
result = 31 * result + (users?.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 IamActionDefinition
if (groups != other.groups) return false
if (policyArn != other.policyArn) return false
if (roles != other.roles) return false
if (users != other.users) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.budgets.model.IamActionDefinition = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A list of groups to be attached. There must be at least one group.
*/
public var groups: List? = null
/**
* The Amazon Resource Name (ARN) of the policy to be attached.
*/
public var policyArn: kotlin.String? = null
/**
* A list of roles to be attached. There must be at least one role.
*/
public var roles: List? = null
/**
* A list of users to be attached. There must be at least one user.
*/
public var users: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.budgets.model.IamActionDefinition) : this() {
this.groups = x.groups
this.policyArn = x.policyArn
this.roles = x.roles
this.users = x.users
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.budgets.model.IamActionDefinition = IamActionDefinition(this)
internal fun correctErrors(): Builder {
if (policyArn == null) policyArn = ""
return this
}
}
}