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

com.pulumi.gcp.firebase.kotlin.HostingChannelArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.firebase.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.firebase.HostingChannelArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Firebasehosting Channel Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-with-channel",
 * });
 * const defaultHostingChannel = new gcp.firebase.HostingChannel("default", {
 *     siteId: _default.siteId,
 *     channelId: "channel-basic",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-with-channel")
 * default_hosting_channel = gcp.firebase.HostingChannel("default",
 *     site_id=default.site_id,
 *     channel_id="channel-basic")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-with-channel",
 *     });
 *     var defaultHostingChannel = new Gcp.Firebase.HostingChannel("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         ChannelId = "channel-basic",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-with-channel"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingChannel(ctx, "default", &firebase.HostingChannelArgs{
 * 			SiteId:    _default.SiteId,
 * 			ChannelId: pulumi.String("channel-basic"),
 * 		})
 * 		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.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.firebase.HostingChannel;
 * import com.pulumi.gcp.firebase.HostingChannelArgs;
 * 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 default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-with-channel")
 *             .build());
 *         var defaultHostingChannel = new HostingChannel("defaultHostingChannel", HostingChannelArgs.builder()
 *             .siteId(default_.siteId())
 *             .channelId("channel-basic")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-with-channel
 *   defaultHostingChannel:
 *     type: gcp:firebase:HostingChannel
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       channelId: channel-basic
 * ```
 * 
 * ### Firebasehosting Channel Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-with-channel",
 * });
 * const full = new gcp.firebase.HostingChannel("full", {
 *     siteId: _default.siteId,
 *     channelId: "channel-full",
 *     ttl: "86400s",
 *     retainedReleaseCount: 20,
 *     labels: {
 *         "some-key": "some-value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-with-channel")
 * full = gcp.firebase.HostingChannel("full",
 *     site_id=default.site_id,
 *     channel_id="channel-full",
 *     ttl="86400s",
 *     retained_release_count=20,
 *     labels={
 *         "some-key": "some-value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-with-channel",
 *     });
 *     var full = new Gcp.Firebase.HostingChannel("full", new()
 *     {
 *         SiteId = @default.SiteId,
 *         ChannelId = "channel-full",
 *         Ttl = "86400s",
 *         RetainedReleaseCount = 20,
 *         Labels =
 *         {
 *             { "some-key", "some-value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-with-channel"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingChannel(ctx, "full", &firebase.HostingChannelArgs{
 * 			SiteId:               _default.SiteId,
 * 			ChannelId:            pulumi.String("channel-full"),
 * 			Ttl:                  pulumi.String("86400s"),
 * 			RetainedReleaseCount: pulumi.Int(20),
 * 			Labels: pulumi.StringMap{
 * 				"some-key": pulumi.String("some-value"),
 * 			},
 * 		})
 * 		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.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.firebase.HostingChannel;
 * import com.pulumi.gcp.firebase.HostingChannelArgs;
 * 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 default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-with-channel")
 *             .build());
 *         var full = new HostingChannel("full", HostingChannelArgs.builder()
 *             .siteId(default_.siteId())
 *             .channelId("channel-full")
 *             .ttl("86400s")
 *             .retainedReleaseCount(20)
 *             .labels(Map.of("some-key", "some-value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-with-channel
 *   full:
 *     type: gcp:firebase:HostingChannel
 *     properties:
 *       siteId: ${default.siteId}
 *       channelId: channel-full
 *       ttl: 86400s
 *       retainedReleaseCount: 20
 *       labels:
 *         some-key: some-value
 * ```
 * 
 * ## Import
 * Channel can be imported using any of these accepted formats:
 * * `sites/{{site_id}}/channels/{{channel_id}}`
 * * `{{site_id}}/{{channel_id}}`
 * When using the `pulumi import` command, Channel can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebase/hostingChannel:HostingChannel default sites/{{site_id}}/channels/{{channel_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/hostingChannel:HostingChannel default {{site_id}}/{{channel_id}}
 * ```
 * @property channelId Required. Immutable. A unique ID within the site that identifies the channel.
 * - - -
 * @property expireTime The time at which the channel will be automatically deleted. If null, the channel
 * will not be automatically deleted. This field is present in the output whether it's
 * set directly or via the `ttl` field.
 * @property labels Text labels used for extra metadata and/or filtering
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property retainedReleaseCount The number of previous releases to retain on the channel for rollback or other
 * purposes. Must be a number between 1-100. Defaults to 10 for new channels.
 * @property siteId Required. The ID of the site in which to create this channel.
 * @property ttl Input only. A time-to-live for this channel. Sets `expire_time` to the provided
 * duration past the time of the request. A duration in seconds with up to nine fractional
 * digits, terminated by 's'. Example: "86400s" (one day).
 */
public data class HostingChannelArgs(
    public val channelId: Output? = null,
    public val expireTime: Output? = null,
    public val labels: Output>? = null,
    public val retainedReleaseCount: Output? = null,
    public val siteId: Output? = null,
    public val ttl: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.firebase.HostingChannelArgs =
        com.pulumi.gcp.firebase.HostingChannelArgs.builder()
            .channelId(channelId?.applyValue({ args0 -> args0 }))
            .expireTime(expireTime?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .retainedReleaseCount(retainedReleaseCount?.applyValue({ args0 -> args0 }))
            .siteId(siteId?.applyValue({ args0 -> args0 }))
            .ttl(ttl?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [HostingChannelArgs].
 */
@PulumiTagMarker
public class HostingChannelArgsBuilder internal constructor() {
    private var channelId: Output? = null

    private var expireTime: Output? = null

    private var labels: Output>? = null

    private var retainedReleaseCount: Output? = null

    private var siteId: Output? = null

    private var ttl: Output? = null

    /**
     * @param value Required. Immutable. A unique ID within the site that identifies the channel.
     * - - -
     */
    @JvmName("wholctkgbdsqfkkd")
    public suspend fun channelId(`value`: Output) {
        this.channelId = value
    }

    /**
     * @param value The time at which the channel will be automatically deleted. If null, the channel
     * will not be automatically deleted. This field is present in the output whether it's
     * set directly or via the `ttl` field.
     */
    @JvmName("lupeodxlqqsjjsid")
    public suspend fun expireTime(`value`: Output) {
        this.expireTime = value
    }

    /**
     * @param value Text labels used for extra metadata and/or filtering
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("myopmcwnpljulbso")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The number of previous releases to retain on the channel for rollback or other
     * purposes. Must be a number between 1-100. Defaults to 10 for new channels.
     */
    @JvmName("jyoxpnrpgvmbtpvc")
    public suspend fun retainedReleaseCount(`value`: Output) {
        this.retainedReleaseCount = value
    }

    /**
     * @param value Required. The ID of the site in which to create this channel.
     */
    @JvmName("ejogjdimgpoqmwkx")
    public suspend fun siteId(`value`: Output) {
        this.siteId = value
    }

    /**
     * @param value Input only. A time-to-live for this channel. Sets `expire_time` to the provided
     * duration past the time of the request. A duration in seconds with up to nine fractional
     * digits, terminated by 's'. Example: "86400s" (one day).
     */
    @JvmName("wtcnnyoheveillxm")
    public suspend fun ttl(`value`: Output) {
        this.ttl = value
    }

    /**
     * @param value Required. Immutable. A unique ID within the site that identifies the channel.
     * - - -
     */
    @JvmName("sjjbmqpgybiesnaj")
    public suspend fun channelId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.channelId = mapped
    }

    /**
     * @param value The time at which the channel will be automatically deleted. If null, the channel
     * will not be automatically deleted. This field is present in the output whether it's
     * set directly or via the `ttl` field.
     */
    @JvmName("rbnnlfgeunvjkovw")
    public suspend fun expireTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expireTime = mapped
    }

    /**
     * @param value Text labels used for extra metadata and/or filtering
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("vugbfkcewmwpidpe")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Text labels used for extra metadata and/or filtering
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("fbvhnupkifdanwjg")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The number of previous releases to retain on the channel for rollback or other
     * purposes. Must be a number between 1-100. Defaults to 10 for new channels.
     */
    @JvmName("kthcdvnybffdjmbk")
    public suspend fun retainedReleaseCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retainedReleaseCount = mapped
    }

    /**
     * @param value Required. The ID of the site in which to create this channel.
     */
    @JvmName("brqrpomabrlepteg")
    public suspend fun siteId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.siteId = mapped
    }

    /**
     * @param value Input only. A time-to-live for this channel. Sets `expire_time` to the provided
     * duration past the time of the request. A duration in seconds with up to nine fractional
     * digits, terminated by 's'. Example: "86400s" (one day).
     */
    @JvmName("ghdtsyrlwilmqxgy")
    public suspend fun ttl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ttl = mapped
    }

    internal fun build(): HostingChannelArgs = HostingChannelArgs(
        channelId = channelId,
        expireTime = expireTime,
        labels = labels,
        retainedReleaseCount = retainedReleaseCount,
        siteId = siteId,
        ttl = ttl,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy