commonMain.aws.sdk.kotlin.services.resourcegroups.model.ResourceIdentifier.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.resourcegroups.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A structure that contains the ARN of a resource and its resource type.
*/
public class ResourceIdentifier private constructor(builder: Builder) {
/**
* The ARN of a resource.
*/
public val resourceArn: kotlin.String? = builder.resourceArn
/**
* The resource type of a resource, such as `AWS::EC2::Instance`.
*/
public val resourceType: kotlin.String? = builder.resourceType
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.resourcegroups.model.ResourceIdentifier = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ResourceIdentifier(")
append("resourceArn=$resourceArn,")
append("resourceType=$resourceType")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = resourceArn?.hashCode() ?: 0
result = 31 * result + (resourceType?.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 ResourceIdentifier
if (resourceArn != other.resourceArn) return false
if (resourceType != other.resourceType) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.resourcegroups.model.ResourceIdentifier = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ARN of a resource.
*/
public var resourceArn: kotlin.String? = null
/**
* The resource type of a resource, such as `AWS::EC2::Instance`.
*/
public var resourceType: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.resourcegroups.model.ResourceIdentifier) : this() {
this.resourceArn = x.resourceArn
this.resourceType = x.resourceType
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.resourcegroups.model.ResourceIdentifier = ResourceIdentifier(this)
internal fun correctErrors(): Builder {
return this
}
}
}