
commonMain.aws.sdk.kotlin.services.rum.model.PutRumMetricsDestinationRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.rum.model
public class PutRumMetricsDestinationRequest private constructor(builder: Builder) {
/**
* The name of the CloudWatch RUM app monitor that will send the metrics.
*/
public val appMonitorName: kotlin.String = requireNotNull(builder.appMonitorName) { "A non-null value must be provided for appMonitorName" }
/**
* Defines the destination to send the metrics to. Valid values are `CloudWatch` and `Evidently`. If you specify `Evidently`, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.
*/
public val destination: aws.sdk.kotlin.services.rum.model.MetricDestination = requireNotNull(builder.destination) { "A non-null value must be provided for destination" }
/**
* Use this parameter only if `Destination` is `Evidently`. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.
*/
public val destinationArn: kotlin.String? = builder.destinationArn
/**
* This parameter is required if `Destination` is `Evidently`. If `Destination` is `CloudWatch`, don't use this parameter.
*
* This parameter specifies the ARN of an IAM role that RUM will assume to write to the Evidently experiment that you are sending metrics to. This role must have permission to write to that experiment.
*
* If you specify this parameter, you must be signed on to a role that has [PassRole](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) permissions attached to it, to allow the role to be passed. The [ CloudWatchAmazonCloudWatchRUMFullAccess](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/auth-and-access-control-cw.html#managed-policies-cloudwatch-RUM) policy doesn't include `PassRole` permissions.
*/
public val iamRoleArn: kotlin.String? = builder.iamRoleArn
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.rum.model.PutRumMetricsDestinationRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PutRumMetricsDestinationRequest(")
append("appMonitorName=$appMonitorName,")
append("destination=$destination,")
append("destinationArn=$destinationArn,")
append("iamRoleArn=$iamRoleArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = appMonitorName.hashCode()
result = 31 * result + (destination.hashCode())
result = 31 * result + (destinationArn?.hashCode() ?: 0)
result = 31 * result + (iamRoleArn?.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 PutRumMetricsDestinationRequest
if (appMonitorName != other.appMonitorName) return false
if (destination != other.destination) return false
if (destinationArn != other.destinationArn) return false
if (iamRoleArn != other.iamRoleArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.rum.model.PutRumMetricsDestinationRequest = Builder(this).apply(block).build()
public class Builder {
/**
* The name of the CloudWatch RUM app monitor that will send the metrics.
*/
public var appMonitorName: kotlin.String? = null
/**
* Defines the destination to send the metrics to. Valid values are `CloudWatch` and `Evidently`. If you specify `Evidently`, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.
*/
public var destination: aws.sdk.kotlin.services.rum.model.MetricDestination? = null
/**
* Use this parameter only if `Destination` is `Evidently`. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.
*/
public var destinationArn: kotlin.String? = null
/**
* This parameter is required if `Destination` is `Evidently`. If `Destination` is `CloudWatch`, don't use this parameter.
*
* This parameter specifies the ARN of an IAM role that RUM will assume to write to the Evidently experiment that you are sending metrics to. This role must have permission to write to that experiment.
*
* If you specify this parameter, you must be signed on to a role that has [PassRole](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) permissions attached to it, to allow the role to be passed. The [ CloudWatchAmazonCloudWatchRUMFullAccess](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/auth-and-access-control-cw.html#managed-policies-cloudwatch-RUM) policy doesn't include `PassRole` permissions.
*/
public var iamRoleArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.rum.model.PutRumMetricsDestinationRequest) : this() {
this.appMonitorName = x.appMonitorName
this.destination = x.destination
this.destinationArn = x.destinationArn
this.iamRoleArn = x.iamRoleArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.rum.model.PutRumMetricsDestinationRequest = PutRumMetricsDestinationRequest(this)
internal fun correctErrors(): Builder {
if (appMonitorName == null) appMonitorName = ""
if (destination == null) destination = MetricDestination.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy