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

commonMain.aws.sdk.kotlin.services.macie.MacieClient.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.macie

import aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider
import aws.sdk.kotlin.runtime.auth.credentials.internal.borrow
import aws.sdk.kotlin.runtime.config.retries.resolveRetryStrategy
import aws.sdk.kotlin.runtime.region.resolveRegion
import aws.sdk.kotlin.services.macie.endpoints.DefaultEndpointProvider
import aws.sdk.kotlin.services.macie.endpoints.EndpointProvider
import aws.sdk.kotlin.services.macie.model.*
import aws.sdk.kotlin.services.macie.model.AssociateMemberAccountRequest
import aws.sdk.kotlin.services.macie.model.AssociateMemberAccountResponse
import aws.sdk.kotlin.services.macie.model.AssociateS3ResourcesRequest
import aws.sdk.kotlin.services.macie.model.AssociateS3ResourcesResponse
import aws.sdk.kotlin.services.macie.model.DisassociateMemberAccountRequest
import aws.sdk.kotlin.services.macie.model.DisassociateMemberAccountResponse
import aws.sdk.kotlin.services.macie.model.DisassociateS3ResourcesRequest
import aws.sdk.kotlin.services.macie.model.DisassociateS3ResourcesResponse
import aws.sdk.kotlin.services.macie.model.ListMemberAccountsRequest
import aws.sdk.kotlin.services.macie.model.ListMemberAccountsResponse
import aws.sdk.kotlin.services.macie.model.ListS3ResourcesRequest
import aws.sdk.kotlin.services.macie.model.ListS3ResourcesResponse
import aws.sdk.kotlin.services.macie.model.UpdateS3ResourcesRequest
import aws.sdk.kotlin.services.macie.model.UpdateS3ResourcesResponse
import aws.smithy.kotlin.runtime.SdkClient
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSigner
import aws.smithy.kotlin.runtime.auth.awssigning.DefaultAwsSigner
import aws.smithy.kotlin.runtime.client.SdkLogMode
import aws.smithy.kotlin.runtime.config.SdkClientConfig
import aws.smithy.kotlin.runtime.http.Url
import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
import aws.smithy.kotlin.runtime.retries.RetryStrategy
import aws.smithy.kotlin.runtime.retries.StandardRetryStrategy
import aws.smithy.kotlin.runtime.tracing.DefaultTracer
import aws.smithy.kotlin.runtime.tracing.LoggingTraceProbe
import aws.smithy.kotlin.runtime.tracing.Tracer
import aws.smithy.kotlin.runtime.tracing.TracingClientConfig
import kotlin.collections.MutableList

/**
 * # Amazon Macie Classic
 * Amazon Macie Classic has been discontinued and is no longer available.
 *
 * A new Amazon Macie is now available with significant design improvements and additional features, at a lower price and in most Amazon Web Services Regions. We encourage you to take advantage of the new and improved features, and benefit from the reduced cost. To learn about features and pricing for the new Macie, see [Amazon Macie](http://aws.amazon.com/macie/). To learn how to use the new Macie, see the [Amazon Macie User Guide](https://docs.aws.amazon.com/macie/latest/user/what-is-macie.html).
 */
public interface MacieClient : SdkClient {

    override val serviceName: String
        get() = "Macie"
    /**
     * MacieClient's configuration
     */
    public val config: Config

    public companion object {
        public operator fun invoke(block: Config.Builder.() -> Unit): MacieClient {
            val config = Config.Builder().apply(block).build()
            return DefaultMacieClient(config)
        }

        public operator fun invoke(config: Config): MacieClient = DefaultMacieClient(config)

        /**
         * Construct a [MacieClient] by resolving the configuration from the current environment.
         */
        public suspend fun fromEnvironment(block: (Config.Builder.() -> Unit)? = null): MacieClient {
            val builder = Config.Builder()
            if (block != null) builder.apply(block)
            builder.region = builder.region ?: resolveRegion()
            builder.retryStrategy = builder.retryStrategy ?: resolveRetryStrategy()
            return DefaultMacieClient(builder.build())
        }
    }

    public class Config private constructor(builder: Builder): HttpClientConfig, SdkClientConfig, TracingClientConfig {
        override val httpClientEngine: HttpClientEngine? = builder.httpClientEngine
        public val region: String = requireNotNull(builder.region) { "region is a required configuration property" }
        public val credentialsProvider: CredentialsProvider = builder.credentialsProvider?.borrow() ?: DefaultChainCredentialsProvider(httpClientEngine = httpClientEngine, region = region)
        public val endpointProvider: EndpointProvider = builder.endpointProvider ?: DefaultEndpointProvider()
        public val endpointUrl: Url? = builder.endpointUrl
        public val interceptors: kotlin.collections.List = builder.interceptors
        public val retryStrategy: RetryStrategy = builder.retryStrategy ?: StandardRetryStrategy()
        override val sdkLogMode: SdkLogMode = builder.sdkLogMode
        public val signer: AwsSigner = builder.signer ?: DefaultAwsSigner
        override val tracer: Tracer = builder.tracer ?: DefaultTracer(LoggingTraceProbe, "Macie")
        public val useDualStack: Boolean = builder.useDualStack
        public val useFips: Boolean = builder.useFips
        public companion object {
            public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
        }

        public class Builder {
            /**
             * Override the default HTTP client engine used to make SDK requests (e.g. configure proxy behavior, timeouts, concurrency, etc).
             * NOTE: The caller is responsible for managing the lifetime of the engine when set. The SDK
             * client will not close it when the client is closed.
             */
            public var httpClientEngine: HttpClientEngine? = null

            /**
             * AWS region to make requests to
             */
            public var region: String? = null

            /**
             * The AWS credentials provider to use for authenticating requests. If not provided a
             * [aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider] instance will be used.
             * NOTE: The caller is responsible for managing the lifetime of the provider when set. The SDK
             * client will not close it when the client is closed.
             */
            public var credentialsProvider: CredentialsProvider? = null

            /**
             * The endpoint provider used to determine where to make service requests.
             */
            public var endpointProvider: EndpointProvider? = null

            /**
             * A custom endpoint to use when making requests.
             */
            public var endpointUrl: Url? = null

            /**
             * Add an [aws.smithy.kotlin.runtime.client.Interceptor] that will have access to read and modify
             * the request and response objects as they are processed by the SDK.
             * Interceptors added using this method are executed in the order they are configured and are always
             * later than any added automatically by the SDK.
             */
            public var interceptors: kotlin.collections.MutableList = kotlin.collections.mutableListOf()

            /**
             * The [RetryStrategy] implementation to use for service calls. All API calls will be wrapped by the
             * strategy.
             */
            public var retryStrategy: RetryStrategy? = null

            /**
             * Configure events that will be logged. By default clients will not output
             * raw requests or responses. Use this setting to opt-in to additional debug logging.
             *
             * This can be used to configure logging of requests, responses, retries, etc of SDK clients.
             *
             * **NOTE**: Logging of raw requests or responses may leak sensitive information! It may also have
             * performance considerations when dumping the request/response body. This is primarily a tool for
             * debug purposes.
             */
            public var sdkLogMode: SdkLogMode = SdkLogMode.Default

            /**
             * The implementation of AWS signer to use for signing requests
             */
            public var signer: AwsSigner? = null

            /**
             * The tracer that is responsible for creating trace spans and wiring them up to a tracing backend (e.g.,
             * a trace probe). By default, this will create a standard tracer that uses the service name for the root
             * trace span and delegates to a logging trace probe (i.e.,
             * `DefaultTracer(LoggingTraceProbe, "")`).
             */
            public var tracer: Tracer? = null

            /**
             * Flag to toggle whether to use dual-stack endpoints when making requests.
             */
            public var useDualStack: Boolean = false

            /**
             * Flag to toggle whether to use [FIPS](https://aws.amazon.com/compliance/fips/) endpoints when making requests.
             */
            public var useFips: Boolean = false

            @PublishedApi
            internal fun build(): Config = Config(this)
        }
    }

    /**
     * (Discontinued) Associates a specified Amazon Web Services account with Amazon Macie Classic as a member account.
     */
    public suspend fun associateMemberAccount(input: AssociateMemberAccountRequest): AssociateMemberAccountResponse

    /**
     * (Discontinued) Associates specified S3 resources with Amazon Macie Classic for monitoring and data classification. If `memberAccountId` isn't specified, the action associates specified S3 resources with Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action associates specified S3 resources with Macie Classic for the specified member account.
     */
    public suspend fun associateS3Resources(input: AssociateS3ResourcesRequest): AssociateS3ResourcesResponse

    /**
     * (Discontinued) Removes the specified member account from Amazon Macie Classic.
     */
    public suspend fun disassociateMemberAccount(input: DisassociateMemberAccountRequest): DisassociateMemberAccountResponse

    /**
     * (Discontinued) Removes specified S3 resources from being monitored by Amazon Macie Classic. If `memberAccountId` isn't specified, the action removes specified S3 resources from Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action removes specified S3 resources from Macie Classic for the specified member account.
     */
    public suspend fun disassociateS3Resources(input: DisassociateS3ResourcesRequest): DisassociateS3ResourcesResponse

    /**
     * (Discontinued) Lists all Amazon Macie Classic member accounts for the current Macie Classic administrator account.
     */
    public suspend fun listMemberAccounts(input: ListMemberAccountsRequest = ListMemberAccountsRequest {}): ListMemberAccountsResponse

    /**
     * (Discontinued) Lists all the S3 resources associated with Amazon Macie Classic. If `memberAccountId` isn't specified, the action lists the S3 resources associated with Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action lists the S3 resources associated with Macie Classic for the specified member account.
     */
    public suspend fun listS3Resources(input: ListS3ResourcesRequest = ListS3ResourcesRequest {}): ListS3ResourcesResponse

    /**
     * (Discontinued) Updates the classification types for the specified S3 resources. If `memberAccountId` isn't specified, the action updates the classification types of the S3 resources associated with Amazon Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action updates the classification types of the S3 resources associated with Macie Classic for the specified member account.
     */
    public suspend fun updateS3Resources(input: UpdateS3ResourcesRequest): UpdateS3ResourcesResponse
}

/**
 * (Discontinued) Associates a specified Amazon Web Services account with Amazon Macie Classic as a member account.
 */
public suspend inline fun MacieClient.associateMemberAccount(crossinline block: AssociateMemberAccountRequest.Builder.() -> Unit): AssociateMemberAccountResponse = associateMemberAccount(AssociateMemberAccountRequest.Builder().apply(block).build())

/**
 * (Discontinued) Associates specified S3 resources with Amazon Macie Classic for monitoring and data classification. If `memberAccountId` isn't specified, the action associates specified S3 resources with Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action associates specified S3 resources with Macie Classic for the specified member account.
 */
public suspend inline fun MacieClient.associateS3Resources(crossinline block: AssociateS3ResourcesRequest.Builder.() -> Unit): AssociateS3ResourcesResponse = associateS3Resources(AssociateS3ResourcesRequest.Builder().apply(block).build())

/**
 * (Discontinued) Removes the specified member account from Amazon Macie Classic.
 */
public suspend inline fun MacieClient.disassociateMemberAccount(crossinline block: DisassociateMemberAccountRequest.Builder.() -> Unit): DisassociateMemberAccountResponse = disassociateMemberAccount(DisassociateMemberAccountRequest.Builder().apply(block).build())

/**
 * (Discontinued) Removes specified S3 resources from being monitored by Amazon Macie Classic. If `memberAccountId` isn't specified, the action removes specified S3 resources from Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action removes specified S3 resources from Macie Classic for the specified member account.
 */
public suspend inline fun MacieClient.disassociateS3Resources(crossinline block: DisassociateS3ResourcesRequest.Builder.() -> Unit): DisassociateS3ResourcesResponse = disassociateS3Resources(DisassociateS3ResourcesRequest.Builder().apply(block).build())

/**
 * (Discontinued) Lists all Amazon Macie Classic member accounts for the current Macie Classic administrator account.
 */
public suspend inline fun MacieClient.listMemberAccounts(crossinline block: ListMemberAccountsRequest.Builder.() -> Unit): ListMemberAccountsResponse = listMemberAccounts(ListMemberAccountsRequest.Builder().apply(block).build())

/**
 * (Discontinued) Lists all the S3 resources associated with Amazon Macie Classic. If `memberAccountId` isn't specified, the action lists the S3 resources associated with Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action lists the S3 resources associated with Macie Classic for the specified member account.
 */
public suspend inline fun MacieClient.listS3Resources(crossinline block: ListS3ResourcesRequest.Builder.() -> Unit): ListS3ResourcesResponse = listS3Resources(ListS3ResourcesRequest.Builder().apply(block).build())

/**
 * (Discontinued) Updates the classification types for the specified S3 resources. If `memberAccountId` isn't specified, the action updates the classification types of the S3 resources associated with Amazon Macie Classic for the current Macie Classic administrator account. If `memberAccountId` is specified, the action updates the classification types of the S3 resources associated with Macie Classic for the specified member account.
 */
public suspend inline fun MacieClient.updateS3Resources(crossinline block: UpdateS3ResourcesRequest.Builder.() -> Unit): UpdateS3ResourcesResponse = updateS3Resources(UpdateS3ResourcesRequest.Builder().apply(block).build())




© 2015 - 2025 Weber Informatics LLC | Privacy Policy