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

commonMain.aws.sdk.kotlin.services.applicationsignals.model.ServiceDependency.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationsignals.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * This structure contains information about one dependency of this service.
 */
public class ServiceDependency private constructor(builder: Builder) {
    /**
     * This is a string-to-string map. It can include the following fields.
     * + `Type` designates the type of object this is.
     * + `ResourceType` specifies the type of the resource. This field is used only when the value of the `Type` field is `Resource` or `AWS::Resource`.
     * + `Name` specifies the name of the object. This is used only if the value of the `Type` field is `Service`, `RemoteService`, or `AWS::Service`.
     * + `Identifier` identifies the resource objects of this resource. This is used only if the value of the `Type` field is `Resource` or `AWS::Resource`.
     * + `Environment` specifies the location where this object is hosted, or what it belongs to.
     */
    public val dependencyKeyAttributes: Map = requireNotNull(builder.dependencyKeyAttributes) { "A non-null value must be provided for dependencyKeyAttributes" }
    /**
     * The name of the called operation in the dependency.
     */
    public val dependencyOperationName: kotlin.String = requireNotNull(builder.dependencyOperationName) { "A non-null value must be provided for dependencyOperationName" }
    /**
     * An array of structures that each contain information about one metric associated with this service dependency that was discovered by Application Signals.
     */
    public val metricReferences: List = requireNotNull(builder.metricReferences) { "A non-null value must be provided for metricReferences" }
    /**
     * The name of the operation in this service that calls the dependency.
     */
    public val operationName: kotlin.String = requireNotNull(builder.operationName) { "A non-null value must be provided for operationName" }

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

    override fun toString(): kotlin.String = buildString {
        append("ServiceDependency(")
        append("dependencyKeyAttributes=$dependencyKeyAttributes,")
        append("dependencyOperationName=$dependencyOperationName,")
        append("metricReferences=$metricReferences,")
        append("operationName=$operationName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dependencyKeyAttributes.hashCode()
        result = 31 * result + (dependencyOperationName.hashCode())
        result = 31 * result + (metricReferences.hashCode())
        result = 31 * result + (operationName.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 ServiceDependency

        if (dependencyKeyAttributes != other.dependencyKeyAttributes) return false
        if (dependencyOperationName != other.dependencyOperationName) return false
        if (metricReferences != other.metricReferences) return false
        if (operationName != other.operationName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * This is a string-to-string map. It can include the following fields.
         * + `Type` designates the type of object this is.
         * + `ResourceType` specifies the type of the resource. This field is used only when the value of the `Type` field is `Resource` or `AWS::Resource`.
         * + `Name` specifies the name of the object. This is used only if the value of the `Type` field is `Service`, `RemoteService`, or `AWS::Service`.
         * + `Identifier` identifies the resource objects of this resource. This is used only if the value of the `Type` field is `Resource` or `AWS::Resource`.
         * + `Environment` specifies the location where this object is hosted, or what it belongs to.
         */
        public var dependencyKeyAttributes: Map? = null
        /**
         * The name of the called operation in the dependency.
         */
        public var dependencyOperationName: kotlin.String? = null
        /**
         * An array of structures that each contain information about one metric associated with this service dependency that was discovered by Application Signals.
         */
        public var metricReferences: List? = null
        /**
         * The name of the operation in this service that calls the dependency.
         */
        public var operationName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.ServiceDependency) : this() {
            this.dependencyKeyAttributes = x.dependencyKeyAttributes
            this.dependencyOperationName = x.dependencyOperationName
            this.metricReferences = x.metricReferences
            this.operationName = x.operationName
        }

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

        internal fun correctErrors(): Builder {
            if (dependencyKeyAttributes == null) dependencyKeyAttributes = emptyMap()
            if (dependencyOperationName == null) dependencyOperationName = ""
            if (metricReferences == null) metricReferences = emptyList()
            if (operationName == null) operationName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy