
commonMain.aws.sdk.kotlin.services.s3.model.MetricsConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.model
/**
* Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html).
*/
public class MetricsConfiguration private constructor(builder: Builder) {
/**
* Specifies a metrics configuration filter. The metrics configuration will only include objects that meet the filter's criteria. A filter must be a prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator).
*/
public val filter: aws.sdk.kotlin.services.s3.model.MetricsFilter? = builder.filter
/**
* The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores.
*/
public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.MetricsConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MetricsConfiguration(")
append("filter=$filter,")
append("id=$id")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = filter?.hashCode() ?: 0
result = 31 * result + (id.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 MetricsConfiguration
if (filter != other.filter) return false
if (id != other.id) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.MetricsConfiguration = Builder(this).apply(block).build()
public class Builder {
/**
* Specifies a metrics configuration filter. The metrics configuration will only include objects that meet the filter's criteria. A filter must be a prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator).
*/
public var filter: aws.sdk.kotlin.services.s3.model.MetricsFilter? = null
/**
* The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores.
*/
public var id: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.MetricsConfiguration) : this() {
this.filter = x.filter
this.id = x.id
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.MetricsConfiguration = MetricsConfiguration(this)
internal fun correctErrors(): Builder {
if (id == null) id = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy