All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.iot.model.CreateFleetMetricRequest.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iot.model



public class CreateFleetMetricRequest private constructor(builder: Builder) {
    /**
     * The field to aggregate.
     */
    public val aggregationField: kotlin.String? = builder.aggregationField
    /**
     * The type of the aggregation query.
     */
    public val aggregationType: aws.sdk.kotlin.services.iot.model.AggregationType? = builder.aggregationType
    /**
     * The fleet metric description.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The name of the index to search.
     */
    public val indexName: kotlin.String? = builder.indexName
    /**
     * The name of the fleet metric to create.
     */
    public val metricName: kotlin.String? = builder.metricName
    /**
     * The time in seconds between fleet metric emissions. Range [60(1 min), 86400(1 day)] and must be multiple of 60.
     */
    public val period: kotlin.Int? = builder.period
    /**
     * The search query string.
     */
    public val queryString: kotlin.String? = builder.queryString
    /**
     * The query version.
     */
    public val queryVersion: kotlin.String? = builder.queryVersion
    /**
     * Metadata, which can be used to manage the fleet metric.
     */
    public val tags: List? = builder.tags
    /**
     * Used to support unit transformation such as milliseconds to seconds. The unit must be supported by [CW metric](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html). Default to null.
     */
    public val unit: aws.sdk.kotlin.services.iot.model.FleetMetricUnit? = builder.unit

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iot.model.CreateFleetMetricRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateFleetMetricRequest(")
        append("aggregationField=$aggregationField,")
        append("aggregationType=$aggregationType,")
        append("description=$description,")
        append("indexName=$indexName,")
        append("metricName=$metricName,")
        append("period=$period,")
        append("queryString=$queryString,")
        append("queryVersion=$queryVersion,")
        append("tags=$tags,")
        append("unit=$unit")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = aggregationField?.hashCode() ?: 0
        result = 31 * result + (aggregationType?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (indexName?.hashCode() ?: 0)
        result = 31 * result + (metricName?.hashCode() ?: 0)
        result = 31 * result + (period ?: 0)
        result = 31 * result + (queryString?.hashCode() ?: 0)
        result = 31 * result + (queryVersion?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (unit?.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 CreateFleetMetricRequest

        if (aggregationField != other.aggregationField) return false
        if (aggregationType != other.aggregationType) return false
        if (description != other.description) return false
        if (indexName != other.indexName) return false
        if (metricName != other.metricName) return false
        if (period != other.period) return false
        if (queryString != other.queryString) return false
        if (queryVersion != other.queryVersion) return false
        if (tags != other.tags) return false
        if (unit != other.unit) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iot.model.CreateFleetMetricRequest = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The field to aggregate.
         */
        public var aggregationField: kotlin.String? = null
        /**
         * The type of the aggregation query.
         */
        public var aggregationType: aws.sdk.kotlin.services.iot.model.AggregationType? = null
        /**
         * The fleet metric description.
         */
        public var description: kotlin.String? = null
        /**
         * The name of the index to search.
         */
        public var indexName: kotlin.String? = null
        /**
         * The name of the fleet metric to create.
         */
        public var metricName: kotlin.String? = null
        /**
         * The time in seconds between fleet metric emissions. Range [60(1 min), 86400(1 day)] and must be multiple of 60.
         */
        public var period: kotlin.Int? = null
        /**
         * The search query string.
         */
        public var queryString: kotlin.String? = null
        /**
         * The query version.
         */
        public var queryVersion: kotlin.String? = null
        /**
         * Metadata, which can be used to manage the fleet metric.
         */
        public var tags: List? = null
        /**
         * Used to support unit transformation such as milliseconds to seconds. The unit must be supported by [CW metric](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html). Default to null.
         */
        public var unit: aws.sdk.kotlin.services.iot.model.FleetMetricUnit? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CreateFleetMetricRequest) : this() {
            this.aggregationField = x.aggregationField
            this.aggregationType = x.aggregationType
            this.description = x.description
            this.indexName = x.indexName
            this.metricName = x.metricName
            this.period = x.period
            this.queryString = x.queryString
            this.queryVersion = x.queryVersion
            this.tags = x.tags
            this.unit = x.unit
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.iot.model.CreateFleetMetricRequest = CreateFleetMetricRequest(this)

        /**
         * construct an [aws.sdk.kotlin.services.iot.model.AggregationType] inside the given [block]
         */
        public fun aggregationType(block: aws.sdk.kotlin.services.iot.model.AggregationType.Builder.() -> kotlin.Unit) {
            this.aggregationType = aws.sdk.kotlin.services.iot.model.AggregationType.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy