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

commonMain.aws.sdk.kotlin.services.appflow.model.PardotConnectorProfileCredentials.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.appflow.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The connector-specific profile credentials required when using Salesforce Pardot.
 */
public class PardotConnectorProfileCredentials private constructor(builder: Builder) {
    /**
     * The credentials used to access protected Salesforce Pardot resources.
     */
    public val accessToken: kotlin.String? = builder.accessToken
    /**
     * The secret manager ARN, which contains the client ID and client secret of the connected app.
     */
    public val clientCredentialsArn: kotlin.String? = builder.clientCredentialsArn
    /**
     * Used by select connectors for which the OAuth workflow is supported, such as Salesforce, Google Analytics, Marketo, Zendesk, and Slack.
     */
    public val oAuthRequest: aws.sdk.kotlin.services.appflow.model.ConnectorOAuthRequest? = builder.oAuthRequest
    /**
     * The credentials used to acquire new access tokens.
     */
    public val refreshToken: kotlin.String? = builder.refreshToken

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

    override fun toString(): kotlin.String = buildString {
        append("PardotConnectorProfileCredentials(")
        append("accessToken=*** Sensitive Data Redacted ***,")
        append("clientCredentialsArn=*** Sensitive Data Redacted ***,")
        append("oAuthRequest=$oAuthRequest,")
        append("refreshToken=$refreshToken")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = accessToken?.hashCode() ?: 0
        result = 31 * result + (clientCredentialsArn?.hashCode() ?: 0)
        result = 31 * result + (oAuthRequest?.hashCode() ?: 0)
        result = 31 * result + (refreshToken?.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 PardotConnectorProfileCredentials

        if (accessToken != other.accessToken) return false
        if (clientCredentialsArn != other.clientCredentialsArn) return false
        if (oAuthRequest != other.oAuthRequest) return false
        if (refreshToken != other.refreshToken) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The credentials used to access protected Salesforce Pardot resources.
         */
        public var accessToken: kotlin.String? = null
        /**
         * The secret manager ARN, which contains the client ID and client secret of the connected app.
         */
        public var clientCredentialsArn: kotlin.String? = null
        /**
         * Used by select connectors for which the OAuth workflow is supported, such as Salesforce, Google Analytics, Marketo, Zendesk, and Slack.
         */
        public var oAuthRequest: aws.sdk.kotlin.services.appflow.model.ConnectorOAuthRequest? = null
        /**
         * The credentials used to acquire new access tokens.
         */
        public var refreshToken: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appflow.model.PardotConnectorProfileCredentials) : this() {
            this.accessToken = x.accessToken
            this.clientCredentialsArn = x.clientCredentialsArn
            this.oAuthRequest = x.oAuthRequest
            this.refreshToken = x.refreshToken
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy