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

com.pulumi.azurenative.securityinsights.kotlin.Incident.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.securityinsights.kotlin

import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentAdditionalDataResponse
import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentLabelResponse
import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentOwnerInfoResponse
import com.pulumi.azurenative.securityinsights.kotlin.outputs.SystemDataResponse
import com.pulumi.core.Output
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentAdditionalDataResponse.Companion.toKotlin as incidentAdditionalDataResponseToKotlin
import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentLabelResponse.Companion.toKotlin as incidentLabelResponseToKotlin
import com.pulumi.azurenative.securityinsights.kotlin.outputs.IncidentOwnerInfoResponse.Companion.toKotlin as incidentOwnerInfoResponseToKotlin
import com.pulumi.azurenative.securityinsights.kotlin.outputs.SystemDataResponse.Companion.toKotlin as systemDataResponseToKotlin

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

    public var args: IncidentArgs = IncidentArgs()

    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 IncidentArgsBuilder.() -> Unit) {
        val builder = IncidentArgsBuilder()
        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(): Incident {
        val builtJavaResource =
            com.pulumi.azurenative.securityinsights.Incident(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return Incident(builtJavaResource)
    }
}

/**
 * Represents an incident in Azure Security Insights.
 * Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-01-01.
 * Other available API versions: 2021-03-01-preview, 2023-02-01-preview, 2023-03-01-preview, 2023-06-01-preview, 2023-07-01-preview, 2023-08-01-preview, 2023-09-01-preview, 2023-10-01-preview, 2023-11-01, 2023-12-01-preview, 2024-01-01-preview, 2024-03-01.
 * ## Example Usage
 * ### Creates or updates an incident.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var incident = new AzureNative.SecurityInsights.Incident("incident", new()
 *     {
 *         Classification = AzureNative.SecurityInsights.IncidentClassification.FalsePositive,
 *         ClassificationComment = "Not a malicious activity",
 *         ClassificationReason = AzureNative.SecurityInsights.IncidentClassificationReason.IncorrectAlertLogic,
 *         Description = "This is a demo incident",
 *         FirstActivityTimeUtc = "2019-01-01T13:00:30Z",
 *         IncidentId = "73e01a99-5cd7-4139-a149-9f2736ff2ab5",
 *         LastActivityTimeUtc = "2019-01-01T13:05:30Z",
 *         Owner = new AzureNative.SecurityInsights.Inputs.IncidentOwnerInfoArgs
 *         {
 *             ObjectId = "2046feea-040d-4a46-9e2b-91c2941bfa70",
 *         },
 *         ResourceGroupName = "myRg",
 *         Severity = AzureNative.SecurityInsights.IncidentSeverity.High,
 *         Status = AzureNative.SecurityInsights.IncidentStatus.Closed,
 *         Title = "My incident",
 *         WorkspaceName = "myWorkspace",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	securityinsights "github.com/pulumi/pulumi-azure-native-sdk/securityinsights/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := securityinsights.NewIncident(ctx, "incident", &securityinsights.IncidentArgs{
 * 			Classification:        pulumi.String(securityinsights.IncidentClassificationFalsePositive),
 * 			ClassificationComment: pulumi.String("Not a malicious activity"),
 * 			ClassificationReason:  pulumi.String(securityinsights.IncidentClassificationReasonIncorrectAlertLogic),
 * 			Description:           pulumi.String("This is a demo incident"),
 * 			FirstActivityTimeUtc:  pulumi.String("2019-01-01T13:00:30Z"),
 * 			IncidentId:            pulumi.String("73e01a99-5cd7-4139-a149-9f2736ff2ab5"),
 * 			LastActivityTimeUtc:   pulumi.String("2019-01-01T13:05:30Z"),
 * 			Owner: &securityinsights.IncidentOwnerInfoArgs{
 * 				ObjectId: pulumi.String("2046feea-040d-4a46-9e2b-91c2941bfa70"),
 * 			},
 * 			ResourceGroupName: pulumi.String("myRg"),
 * 			Severity:          pulumi.String(securityinsights.IncidentSeverityHigh),
 * 			Status:            pulumi.String(securityinsights.IncidentStatusClosed),
 * 			Title:             pulumi.String("My incident"),
 * 			WorkspaceName:     pulumi.String("myWorkspace"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.securityinsights.Incident;
 * import com.pulumi.azurenative.securityinsights.IncidentArgs;
 * import com.pulumi.azurenative.securityinsights.inputs.IncidentOwnerInfoArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var incident = new Incident("incident", IncidentArgs.builder()
 *             .classification("FalsePositive")
 *             .classificationComment("Not a malicious activity")
 *             .classificationReason("IncorrectAlertLogic")
 *             .description("This is a demo incident")
 *             .firstActivityTimeUtc("2019-01-01T13:00:30Z")
 *             .incidentId("73e01a99-5cd7-4139-a149-9f2736ff2ab5")
 *             .lastActivityTimeUtc("2019-01-01T13:05:30Z")
 *             .owner(IncidentOwnerInfoArgs.builder()
 *                 .objectId("2046feea-040d-4a46-9e2b-91c2941bfa70")
 *                 .build())
 *             .resourceGroupName("myRg")
 *             .severity("High")
 *             .status("Closed")
 *             .title("My incident")
 *             .workspaceName("myWorkspace")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:securityinsights:Incident 73e01a99-5cd7-4139-a149-9f2736ff2ab5 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}
 * ```
 */
public class Incident internal constructor(
    override val javaResource: com.pulumi.azurenative.securityinsights.Incident,
) : KotlinCustomResource(javaResource, IncidentMapper) {
    /**
     * Additional data on the incident
     */
    public val additionalData: Output
        get() = javaResource.additionalData().applyValue({ args0 ->
            args0.let({ args0 ->
                incidentAdditionalDataResponseToKotlin(args0)
            })
        })

    /**
     * The reason the incident was closed
     */
    public val classification: Output?
        get() = javaResource.classification().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Describes the reason the incident was closed
     */
    public val classificationComment: Output?
        get() = javaResource.classificationComment().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The classification reason the incident was closed with
     */
    public val classificationReason: Output?
        get() = javaResource.classificationReason().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The time the incident was created
     */
    public val createdTimeUtc: Output
        get() = javaResource.createdTimeUtc().applyValue({ args0 -> args0 })

    /**
     * The description of the incident
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Etag of the azure resource
     */
    public val etag: Output?
        get() = javaResource.etag().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The time of the first activity in the incident
     */
    public val firstActivityTimeUtc: Output?
        get() = javaResource.firstActivityTimeUtc().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A sequential number
     */
    public val incidentNumber: Output
        get() = javaResource.incidentNumber().applyValue({ args0 -> args0 })

    /**
     * The deep-link url to the incident in Azure portal
     */
    public val incidentUrl: Output
        get() = javaResource.incidentUrl().applyValue({ args0 -> args0 })

    /**
     * List of labels relevant to this incident
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> incidentLabelResponseToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The time of the last activity in the incident
     */
    public val lastActivityTimeUtc: Output?
        get() = javaResource.lastActivityTimeUtc().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The last time the incident was updated
     */
    public val lastModifiedTimeUtc: Output
        get() = javaResource.lastModifiedTimeUtc().applyValue({ args0 -> args0 })

    /**
     * The name of the resource
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Describes a user that the incident is assigned to
     */
    public val owner: Output?
        get() = javaResource.owner().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    incidentOwnerInfoResponseToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The incident ID assigned by the incident provider
     */
    public val providerIncidentId: Output
        get() = javaResource.providerIncidentId().applyValue({ args0 -> args0 })

    /**
     * The name of the source provider that generated the incident
     */
    public val providerName: Output
        get() = javaResource.providerName().applyValue({ args0 -> args0 })

    /**
     * List of resource ids of Analytic rules related to the incident
     */
    public val relatedAnalyticRuleIds: Output>
        get() = javaResource.relatedAnalyticRuleIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The severity of the incident
     */
    public val severity: Output
        get() = javaResource.severity().applyValue({ args0 -> args0 })

    /**
     * The status of the incident
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 ->
            args0.let({ args0 ->
                systemDataResponseToKotlin(args0)
            })
        })

    /**
     * The title of the incident
     */
    public val title: Output
        get() = javaResource.title().applyValue({ args0 -> args0 })

    /**
     * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object IncidentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.securityinsights.Incident::class == javaResource::class

    override fun map(javaResource: Resource): Incident = Incident(
        javaResource as
            com.pulumi.azurenative.securityinsights.Incident,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy