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

com.pulumi.googlenative.securitycenter.v1.kotlin.OrganizationNotificationConfig.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.securitycenter.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.securitycenter.v1.kotlin.outputs.StreamingConfigResponse
import com.pulumi.googlenative.securitycenter.v1.kotlin.outputs.StreamingConfigResponse.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [OrganizationNotificationConfig].
 */
@PulumiTagMarker
public class OrganizationNotificationConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: OrganizationNotificationConfigArgs = OrganizationNotificationConfigArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend OrganizationNotificationConfigArgsBuilder.() -> Unit) {
        val builder = OrganizationNotificationConfigArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): OrganizationNotificationConfig {
        val builtJavaResource =
            com.pulumi.googlenative.securitycenter.v1.OrganizationNotificationConfig(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return OrganizationNotificationConfig(builtJavaResource)
    }
}

/**
 * Creates a notification config.
 */
public class OrganizationNotificationConfig internal constructor(
    override val javaResource: com.pulumi.googlenative.securitycenter.v1.OrganizationNotificationConfig,
) : KotlinCustomResource(javaResource, OrganizationNotificationConfigMapper) {
    /**
     * Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.
     */
    public val configId: Output
        get() = javaResource.configId().applyValue({ args0 -> args0 })

    /**
     * The description of the notification config (max of 1024 characters).
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: "organizations/{organization_id}/notificationConfigs/notify_public_bucket", "folders/{folder_id}/notificationConfigs/notify_public_bucket", or "projects/{project_id}/notificationConfigs/notify_public_bucket".
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val organizationId: Output
        get() = javaResource.organizationId().applyValue({ args0 -> args0 })

    /**
     * The Pub/Sub topic to send notifications to. Its format is "projects/[project_id]/topics/[topic]".
     */
    public val pubsubTopic: Output
        get() = javaResource.pubsubTopic().applyValue({ args0 -> args0 })

    /**
     * The service account that needs "pubsub.topics.publish" permission to publish to the Pub/Sub topic.
     */
    public val serviceAccount: Output
        get() = javaResource.serviceAccount().applyValue({ args0 -> args0 })

    /**
     * The config for triggering streaming-based notifications.
     */
    public val streamingConfig: Output
        get() = javaResource.streamingConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })
}

public object OrganizationNotificationConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.securitycenter.v1.OrganizationNotificationConfig::class == javaResource::class

    override fun map(javaResource: Resource): OrganizationNotificationConfig =
        OrganizationNotificationConfig(
            javaResource as
                com.pulumi.googlenative.securitycenter.v1.OrganizationNotificationConfig,
        )
}

/**
 * @see [OrganizationNotificationConfig].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [OrganizationNotificationConfig].
 */
public suspend fun organizationNotificationConfig(
    name: String,
    block: suspend OrganizationNotificationConfigResourceBuilder.() -> Unit,
): OrganizationNotificationConfig {
    val builder = OrganizationNotificationConfigResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [OrganizationNotificationConfig].
 * @param name The _unique_ name of the resulting resource.
 */
public fun organizationNotificationConfig(name: String): OrganizationNotificationConfig {
    val builder = OrganizationNotificationConfigResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy