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

commonMain.aws.sdk.kotlin.services.rum.model.CreateAppMonitorRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.rum.model



public class CreateAppMonitorRequest private constructor(builder: Builder) {
    /**
     * A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include `AppMonitorConfiguration`, you must set up your own authorization method. For more information, see [Authorize your application to send data to Amazon Web Services](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html).
     *
     * If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.
     */
    public val appMonitorConfiguration: aws.sdk.kotlin.services.rum.model.AppMonitorConfiguration? = builder.appMonitorConfiguration
    /**
     * Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`.
     *
     * For more information about custom events, see [Send custom events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html).
     */
    public val customEvents: aws.sdk.kotlin.services.rum.model.CustomEvents? = builder.customEvents
    /**
     * Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
     *
     * If you omit this parameter, the default is `false`.
     */
    public val cwLogEnabled: kotlin.Boolean? = builder.cwLogEnabled
    /**
     * The top-level internet domain name for which your application has administrative authority.
     */
    public val domain: kotlin.String = requireNotNull(builder.domain) { "A non-null value must be provided for domain" }
    /**
     * A name for the app monitor.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Assigns one or more tags (key-value pairs) to the app monitor.
     *
     * Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
     *
     * Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
     *
     * You can associate as many as 50 tags with an app monitor.
     *
     * For more information, see [Tagging Amazon Web Services resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html).
     */
    public val tags: Map? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateAppMonitorRequest(")
        append("appMonitorConfiguration=$appMonitorConfiguration,")
        append("customEvents=$customEvents,")
        append("cwLogEnabled=$cwLogEnabled,")
        append("domain=$domain,")
        append("name=$name,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = appMonitorConfiguration?.hashCode() ?: 0
        result = 31 * result + (customEvents?.hashCode() ?: 0)
        result = 31 * result + (cwLogEnabled?.hashCode() ?: 0)
        result = 31 * result + (domain.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (tags?.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 CreateAppMonitorRequest

        if (appMonitorConfiguration != other.appMonitorConfiguration) return false
        if (customEvents != other.customEvents) return false
        if (cwLogEnabled != other.cwLogEnabled) return false
        if (domain != other.domain) return false
        if (name != other.name) return false
        if (tags != other.tags) return false

        return true
    }

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

    public class Builder {
        /**
         * A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include `AppMonitorConfiguration`, you must set up your own authorization method. For more information, see [Authorize your application to send data to Amazon Web Services](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html).
         *
         * If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.
         */
        public var appMonitorConfiguration: aws.sdk.kotlin.services.rum.model.AppMonitorConfiguration? = null
        /**
         * Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`.
         *
         * For more information about custom events, see [Send custom events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html).
         */
        public var customEvents: aws.sdk.kotlin.services.rum.model.CustomEvents? = null
        /**
         * Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
         *
         * If you omit this parameter, the default is `false`.
         */
        public var cwLogEnabled: kotlin.Boolean? = null
        /**
         * The top-level internet domain name for which your application has administrative authority.
         */
        public var domain: kotlin.String? = null
        /**
         * A name for the app monitor.
         */
        public var name: kotlin.String? = null
        /**
         * Assigns one or more tags (key-value pairs) to the app monitor.
         *
         * Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
         *
         * Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
         *
         * You can associate as many as 50 tags with an app monitor.
         *
         * For more information, see [Tagging Amazon Web Services resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html).
         */
        public var tags: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rum.model.CreateAppMonitorRequest) : this() {
            this.appMonitorConfiguration = x.appMonitorConfiguration
            this.customEvents = x.customEvents
            this.cwLogEnabled = x.cwLogEnabled
            this.domain = x.domain
            this.name = x.name
            this.tags = x.tags
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (domain == null) domain = ""
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy