
commonMain.aws.sdk.kotlin.services.eks.model.AssociateAccessPolicyRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.eks.model
import aws.smithy.kotlin.runtime.SdkDsl
public class AssociateAccessPolicyRequest private constructor(builder: Builder) {
/**
* The scope for the `AccessPolicy`. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.
*/
public val accessScope: aws.sdk.kotlin.services.eks.model.AccessScope? = builder.accessScope
/**
* The name of your cluster.
*/
public val clusterName: kotlin.String? = builder.clusterName
/**
* The ARN of the `AccessPolicy` that you're associating. For a list of ARNs, use `ListAccessPolicies`.
*/
public val policyArn: kotlin.String? = builder.policyArn
/**
* The Amazon Resource Name (ARN) of the IAM user or role for the `AccessEntry` that you're associating the access policy to.
*/
public val principalArn: kotlin.String? = builder.principalArn
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.eks.model.AssociateAccessPolicyRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AssociateAccessPolicyRequest(")
append("accessScope=$accessScope,")
append("clusterName=$clusterName,")
append("policyArn=$policyArn,")
append("principalArn=$principalArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessScope?.hashCode() ?: 0
result = 31 * result + (clusterName?.hashCode() ?: 0)
result = 31 * result + (policyArn?.hashCode() ?: 0)
result = 31 * result + (principalArn?.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 AssociateAccessPolicyRequest
if (accessScope != other.accessScope) return false
if (clusterName != other.clusterName) return false
if (policyArn != other.policyArn) return false
if (principalArn != other.principalArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.eks.model.AssociateAccessPolicyRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The scope for the `AccessPolicy`. You can scope access policies to an entire cluster or to specific Kubernetes namespaces.
*/
public var accessScope: aws.sdk.kotlin.services.eks.model.AccessScope? = null
/**
* The name of your cluster.
*/
public var clusterName: kotlin.String? = null
/**
* The ARN of the `AccessPolicy` that you're associating. For a list of ARNs, use `ListAccessPolicies`.
*/
public var policyArn: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the IAM user or role for the `AccessEntry` that you're associating the access policy to.
*/
public var principalArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.eks.model.AssociateAccessPolicyRequest) : this() {
this.accessScope = x.accessScope
this.clusterName = x.clusterName
this.policyArn = x.policyArn
this.principalArn = x.principalArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.eks.model.AssociateAccessPolicyRequest = AssociateAccessPolicyRequest(this)
/**
* construct an [aws.sdk.kotlin.services.eks.model.AccessScope] inside the given [block]
*/
public fun accessScope(block: aws.sdk.kotlin.services.eks.model.AccessScope.Builder.() -> kotlin.Unit) {
this.accessScope = aws.sdk.kotlin.services.eks.model.AccessScope.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy