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

com.pulumi.gcp.containeranalysis.kotlin.NoteArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.containeranalysis.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.containeranalysis.NoteArgs.builder
import com.pulumi.gcp.containeranalysis.kotlin.inputs.NoteAttestationAuthorityArgs
import com.pulumi.gcp.containeranalysis.kotlin.inputs.NoteAttestationAuthorityArgsBuilder
import com.pulumi.gcp.containeranalysis.kotlin.inputs.NoteRelatedUrlArgs
import com.pulumi.gcp.containeranalysis.kotlin.inputs.NoteRelatedUrlArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A Container Analysis note is a high-level piece of metadata that
 * describes a type of analysis that can be done for a resource.
 * To get more information about Note, see:
 * * [API documentation](https://cloud.google.com/container-analysis/api/reference/rest/)
 * * How-to Guides
 *     * [Creating Attestations (Occurrences)](https://cloud.google.com/binary-authorization/docs/making-attestations)
 *     * [Official Documentation](https://cloud.google.com/container-analysis/)
 * ## Example Usage
 * ### Container Analysis Note Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const note = new gcp.containeranalysis.Note("note", {
 *     name: "attestor-note",
 *     attestationAuthority: {
 *         hint: {
 *             humanReadableName: "Attestor Note",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * note = gcp.containeranalysis.Note("note",
 *     name="attestor-note",
 *     attestation_authority={
 *         "hint": {
 *             "human_readable_name": "Attestor Note",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var note = new Gcp.ContainerAnalysis.Note("note", new()
 *     {
 *         Name = "attestor-note",
 *         AttestationAuthority = new Gcp.ContainerAnalysis.Inputs.NoteAttestationAuthorityArgs
 *         {
 *             Hint = new Gcp.ContainerAnalysis.Inputs.NoteAttestationAuthorityHintArgs
 *             {
 *                 HumanReadableName = "Attestor Note",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/containeranalysis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := containeranalysis.NewNote(ctx, "note", &containeranalysis.NoteArgs{
 * 			Name: pulumi.String("attestor-note"),
 * 			AttestationAuthority: &containeranalysis.NoteAttestationAuthorityArgs{
 * 				Hint: &containeranalysis.NoteAttestationAuthorityHintArgs{
 * 					HumanReadableName: pulumi.String("Attestor Note"),
 * 				},
 * 			},
 * 		})
 * 		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.gcp.containeranalysis.Note;
 * import com.pulumi.gcp.containeranalysis.NoteArgs;
 * import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityArgs;
 * import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityHintArgs;
 * 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 note = new Note("note", NoteArgs.builder()
 *             .name("attestor-note")
 *             .attestationAuthority(NoteAttestationAuthorityArgs.builder()
 *                 .hint(NoteAttestationAuthorityHintArgs.builder()
 *                     .humanReadableName("Attestor Note")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   note:
 *     type: gcp:containeranalysis:Note
 *     properties:
 *       name: attestor-note
 *       attestationAuthority:
 *         hint:
 *           humanReadableName: Attestor Note
 * ```
 * 
 * ### Container Analysis Note Attestation Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const note = new gcp.containeranalysis.Note("note", {
 *     name: "attestor-note",
 *     shortDescription: "test note",
 *     longDescription: "a longer description of test note",
 *     expirationTime: "2120-10-02T15:01:23.045123456Z",
 *     relatedUrls: [
 *         {
 *             url: "some.url",
 *             label: "foo",
 *         },
 *         {
 *             url: "google.com",
 *         },
 *     ],
 *     attestationAuthority: {
 *         hint: {
 *             humanReadableName: "Attestor Note",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * note = gcp.containeranalysis.Note("note",
 *     name="attestor-note",
 *     short_description="test note",
 *     long_description="a longer description of test note",
 *     expiration_time="2120-10-02T15:01:23.045123456Z",
 *     related_urls=[
 *         {
 *             "url": "some.url",
 *             "label": "foo",
 *         },
 *         {
 *             "url": "google.com",
 *         },
 *     ],
 *     attestation_authority={
 *         "hint": {
 *             "human_readable_name": "Attestor Note",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var note = new Gcp.ContainerAnalysis.Note("note", new()
 *     {
 *         Name = "attestor-note",
 *         ShortDescription = "test note",
 *         LongDescription = "a longer description of test note",
 *         ExpirationTime = "2120-10-02T15:01:23.045123456Z",
 *         RelatedUrls = new[]
 *         {
 *             new Gcp.ContainerAnalysis.Inputs.NoteRelatedUrlArgs
 *             {
 *                 Url = "some.url",
 *                 Label = "foo",
 *             },
 *             new Gcp.ContainerAnalysis.Inputs.NoteRelatedUrlArgs
 *             {
 *                 Url = "google.com",
 *             },
 *         },
 *         AttestationAuthority = new Gcp.ContainerAnalysis.Inputs.NoteAttestationAuthorityArgs
 *         {
 *             Hint = new Gcp.ContainerAnalysis.Inputs.NoteAttestationAuthorityHintArgs
 *             {
 *                 HumanReadableName = "Attestor Note",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/containeranalysis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := containeranalysis.NewNote(ctx, "note", &containeranalysis.NoteArgs{
 * 			Name:             pulumi.String("attestor-note"),
 * 			ShortDescription: pulumi.String("test note"),
 * 			LongDescription:  pulumi.String("a longer description of test note"),
 * 			ExpirationTime:   pulumi.String("2120-10-02T15:01:23.045123456Z"),
 * 			RelatedUrls: containeranalysis.NoteRelatedUrlArray{
 * 				&containeranalysis.NoteRelatedUrlArgs{
 * 					Url:   pulumi.String("some.url"),
 * 					Label: pulumi.String("foo"),
 * 				},
 * 				&containeranalysis.NoteRelatedUrlArgs{
 * 					Url: pulumi.String("google.com"),
 * 				},
 * 			},
 * 			AttestationAuthority: &containeranalysis.NoteAttestationAuthorityArgs{
 * 				Hint: &containeranalysis.NoteAttestationAuthorityHintArgs{
 * 					HumanReadableName: pulumi.String("Attestor Note"),
 * 				},
 * 			},
 * 		})
 * 		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.gcp.containeranalysis.Note;
 * import com.pulumi.gcp.containeranalysis.NoteArgs;
 * import com.pulumi.gcp.containeranalysis.inputs.NoteRelatedUrlArgs;
 * import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityArgs;
 * import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityHintArgs;
 * 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 note = new Note("note", NoteArgs.builder()
 *             .name("attestor-note")
 *             .shortDescription("test note")
 *             .longDescription("a longer description of test note")
 *             .expirationTime("2120-10-02T15:01:23.045123456Z")
 *             .relatedUrls(
 *                 NoteRelatedUrlArgs.builder()
 *                     .url("some.url")
 *                     .label("foo")
 *                     .build(),
 *                 NoteRelatedUrlArgs.builder()
 *                     .url("google.com")
 *                     .build())
 *             .attestationAuthority(NoteAttestationAuthorityArgs.builder()
 *                 .hint(NoteAttestationAuthorityHintArgs.builder()
 *                     .humanReadableName("Attestor Note")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   note:
 *     type: gcp:containeranalysis:Note
 *     properties:
 *       name: attestor-note
 *       shortDescription: test note
 *       longDescription: a longer description of test note
 *       expirationTime: 2120-10-02T15:01:23.045123456Z
 *       relatedUrls:
 *         - url: some.url
 *           label: foo
 *         - url: google.com
 *       attestationAuthority:
 *         hint:
 *           humanReadableName: Attestor Note
 * ```
 * 
 * ## Import
 * Note can be imported using any of these accepted formats:
 * * `projects/{{project}}/notes/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Note can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:containeranalysis/note:Note default projects/{{project}}/notes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:containeranalysis/note:Note default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:containeranalysis/note:Note default {{name}}
 * ```
 * @property attestationAuthority Note kind that represents a logical attestation "role" or "authority".
 * For example, an organization might have one AttestationAuthority for
 * "QA" and one for "build". This Note is intended to act strictly as a
 * grouping mechanism for the attached Occurrences (Attestations). This
 * grouping mechanism also provides a security boundary, since IAM ACLs
 * gate the ability for a principle to attach an Occurrence to a given
 * Note. It also provides a single point of lookup to find all attached
 * Attestation Occurrences, even if they don't all live in the same
 * project.
 * Structure is documented below.
 * @property expirationTime Time of expiration for this note. Leave empty if note does not expire.
 * @property longDescription A detailed description of the note
 * @property name The name of the note.
 * @property project
 * @property relatedNoteNames Names of other notes related to this note.
 * @property relatedUrls URLs associated with this note and related metadata.
 * @property shortDescription A one sentence description of the note.
 */
public data class NoteArgs(
    public val attestationAuthority: Output? = null,
    public val expirationTime: Output? = null,
    public val longDescription: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val relatedNoteNames: Output>? = null,
    public val relatedUrls: Output>? = null,
    public val shortDescription: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.containeranalysis.NoteArgs =
        com.pulumi.gcp.containeranalysis.NoteArgs.builder()
            .attestationAuthority(
                attestationAuthority?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .expirationTime(expirationTime?.applyValue({ args0 -> args0 }))
            .longDescription(longDescription?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .relatedNoteNames(relatedNoteNames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .relatedUrls(
                relatedUrls?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .shortDescription(shortDescription?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [NoteArgs].
 */
@PulumiTagMarker
public class NoteArgsBuilder internal constructor() {
    private var attestationAuthority: Output? = null

    private var expirationTime: Output? = null

    private var longDescription: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var relatedNoteNames: Output>? = null

    private var relatedUrls: Output>? = null

    private var shortDescription: Output? = null

    /**
     * @param value Note kind that represents a logical attestation "role" or "authority".
     * For example, an organization might have one AttestationAuthority for
     * "QA" and one for "build". This Note is intended to act strictly as a
     * grouping mechanism for the attached Occurrences (Attestations). This
     * grouping mechanism also provides a security boundary, since IAM ACLs
     * gate the ability for a principle to attach an Occurrence to a given
     * Note. It also provides a single point of lookup to find all attached
     * Attestation Occurrences, even if they don't all live in the same
     * project.
     * Structure is documented below.
     */
    @JvmName("kyfloghrjrewwmci")
    public suspend fun attestationAuthority(`value`: Output) {
        this.attestationAuthority = value
    }

    /**
     * @param value Time of expiration for this note. Leave empty if note does not expire.
     */
    @JvmName("bpwqnmkvhnlrvins")
    public suspend fun expirationTime(`value`: Output) {
        this.expirationTime = value
    }

    /**
     * @param value A detailed description of the note
     */
    @JvmName("ldivhjevqolrqcvr")
    public suspend fun longDescription(`value`: Output) {
        this.longDescription = value
    }

    /**
     * @param value The name of the note.
     */
    @JvmName("aeaapdyaqacihfrb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("twhejgtxbkcoudpw")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Names of other notes related to this note.
     */
    @JvmName("jgoxvcofebaqvhio")
    public suspend fun relatedNoteNames(`value`: Output>) {
        this.relatedNoteNames = value
    }

    @JvmName("lmuhgqaudkcfponj")
    public suspend fun relatedNoteNames(vararg values: Output) {
        this.relatedNoteNames = Output.all(values.asList())
    }

    /**
     * @param values Names of other notes related to this note.
     */
    @JvmName("uqkpyupkwjyquhyp")
    public suspend fun relatedNoteNames(values: List>) {
        this.relatedNoteNames = Output.all(values)
    }

    /**
     * @param value URLs associated with this note and related metadata.
     */
    @JvmName("klteeqnstyjvtjbr")
    public suspend fun relatedUrls(`value`: Output>) {
        this.relatedUrls = value
    }

    @JvmName("pfyixymaqcaqudka")
    public suspend fun relatedUrls(vararg values: Output) {
        this.relatedUrls = Output.all(values.asList())
    }

    /**
     * @param values URLs associated with this note and related metadata.
     */
    @JvmName("enopgriplhmhqhyk")
    public suspend fun relatedUrls(values: List>) {
        this.relatedUrls = Output.all(values)
    }

    /**
     * @param value A one sentence description of the note.
     */
    @JvmName("gfqjacpvnlyycpcs")
    public suspend fun shortDescription(`value`: Output) {
        this.shortDescription = value
    }

    /**
     * @param value Note kind that represents a logical attestation "role" or "authority".
     * For example, an organization might have one AttestationAuthority for
     * "QA" and one for "build". This Note is intended to act strictly as a
     * grouping mechanism for the attached Occurrences (Attestations). This
     * grouping mechanism also provides a security boundary, since IAM ACLs
     * gate the ability for a principle to attach an Occurrence to a given
     * Note. It also provides a single point of lookup to find all attached
     * Attestation Occurrences, even if they don't all live in the same
     * project.
     * Structure is documented below.
     */
    @JvmName("uwwjfldmrnkmlyao")
    public suspend fun attestationAuthority(`value`: NoteAttestationAuthorityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.attestationAuthority = mapped
    }

    /**
     * @param argument Note kind that represents a logical attestation "role" or "authority".
     * For example, an organization might have one AttestationAuthority for
     * "QA" and one for "build". This Note is intended to act strictly as a
     * grouping mechanism for the attached Occurrences (Attestations). This
     * grouping mechanism also provides a security boundary, since IAM ACLs
     * gate the ability for a principle to attach an Occurrence to a given
     * Note. It also provides a single point of lookup to find all attached
     * Attestation Occurrences, even if they don't all live in the same
     * project.
     * Structure is documented below.
     */
    @JvmName("njnljsgybnwoxshm")
    public suspend fun attestationAuthority(argument: suspend NoteAttestationAuthorityArgsBuilder.() -> Unit) {
        val toBeMapped = NoteAttestationAuthorityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.attestationAuthority = mapped
    }

    /**
     * @param value Time of expiration for this note. Leave empty if note does not expire.
     */
    @JvmName("fnnudldvtuhejmag")
    public suspend fun expirationTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expirationTime = mapped
    }

    /**
     * @param value A detailed description of the note
     */
    @JvmName("usjhfirrkudmbetd")
    public suspend fun longDescription(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.longDescription = mapped
    }

    /**
     * @param value The name of the note.
     */
    @JvmName("pxonvxtbahydmeqq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("xoiayxufantsauss")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Names of other notes related to this note.
     */
    @JvmName("ckwtkiovgrmveted")
    public suspend fun relatedNoteNames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relatedNoteNames = mapped
    }

    /**
     * @param values Names of other notes related to this note.
     */
    @JvmName("vmwijofjtdqysbne")
    public suspend fun relatedNoteNames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.relatedNoteNames = mapped
    }

    /**
     * @param value URLs associated with this note and related metadata.
     */
    @JvmName("gvpefkhtopcvssst")
    public suspend fun relatedUrls(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relatedUrls = mapped
    }

    /**
     * @param argument URLs associated with this note and related metadata.
     */
    @JvmName("kayvrtprtrcxkbgy")
    public suspend fun relatedUrls(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NoteRelatedUrlArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.relatedUrls = mapped
    }

    /**
     * @param argument URLs associated with this note and related metadata.
     */
    @JvmName("lclodskmgbhcsevp")
    public suspend fun relatedUrls(vararg argument: suspend NoteRelatedUrlArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NoteRelatedUrlArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.relatedUrls = mapped
    }

    /**
     * @param argument URLs associated with this note and related metadata.
     */
    @JvmName("flhfgpfuykacfsls")
    public suspend fun relatedUrls(argument: suspend NoteRelatedUrlArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(NoteRelatedUrlArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.relatedUrls = mapped
    }

    /**
     * @param values URLs associated with this note and related metadata.
     */
    @JvmName("yajjqldlanadwjrm")
    public suspend fun relatedUrls(vararg values: NoteRelatedUrlArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.relatedUrls = mapped
    }

    /**
     * @param value A one sentence description of the note.
     */
    @JvmName("akceqkkxjsraqlqf")
    public suspend fun shortDescription(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shortDescription = mapped
    }

    internal fun build(): NoteArgs = NoteArgs(
        attestationAuthority = attestationAuthority,
        expirationTime = expirationTime,
        longDescription = longDescription,
        name = name,
        project = project,
        relatedNoteNames = relatedNoteNames,
        relatedUrls = relatedUrls,
        shortDescription = shortDescription,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy