commonMain.aws.sdk.kotlin.services.cloudtrail.model.InvalidTrailNameException.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudtrail-jvm Show documentation
Show all versions of cloudtrail-jvm Show documentation
The AWS SDK for Kotlin client for CloudTrail
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudtrail.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* This exception is thrown when the provided trail name is not valid. Trail names must meet the following requirements:
* + Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
* + Start with a letter or number, and end with a letter or number
* + Be between 3 and 128 characters
* + Have no adjacent periods, underscores or dashes. Names like `my-_namespace` and `my--namespace` are not valid.
* + Not be in IP address format (for example, 192.168.5.4)
*/
public class InvalidTrailNameException private constructor(builder: Builder) : CloudTrailException(builder.message) {
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudtrail.model.InvalidTrailNameException = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("InvalidTrailNameException(")
append("message=$message")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = message?.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 InvalidTrailNameException
if (message != other.message) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudtrail.model.InvalidTrailNameException = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Brief description of the exception returned by the request.
*/
public var message: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudtrail.model.InvalidTrailNameException) : this() {
this.message = x.message
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudtrail.model.InvalidTrailNameException = InvalidTrailNameException(this)
internal fun correctErrors(): Builder {
return this
}
}
}