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

com.pulumi.gcp.projects.kotlin.ServiceArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.projects.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.projects.ServiceArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = new gcp.projects.Service("project", {
 *     project: "your-project-id",
 *     service: "iam.googleapis.com",
 *     disableOnDestroy: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.projects.Service("project",
 *     project="your-project-id",
 *     service="iam.googleapis.com",
 *     disable_on_destroy=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = new Gcp.Projects.Service("project", new()
 *     {
 *         Project = "your-project-id",
 *         ServiceName = "iam.googleapis.com",
 *         DisableOnDestroy = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := projects.NewService(ctx, "project", &projects.ServiceArgs{
 * 			Project:          pulumi.String("your-project-id"),
 * 			Service:          pulumi.String("iam.googleapis.com"),
 * 			DisableOnDestroy: pulumi.Bool(false),
 * 		})
 * 		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.projects.Service;
 * import com.pulumi.gcp.projects.ServiceArgs;
 * 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 project = new Service("project", ServiceArgs.builder()
 *             .project("your-project-id")
 *             .service("iam.googleapis.com")
 *             .disableOnDestroy(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   project:
 *     type: gcp:projects:Service
 *     properties:
 *       project: your-project-id
 *       service: iam.googleapis.com
 *       disableOnDestroy: false
 * ```
 * 
 * ## Import
 * Project services can be imported using the `project_id` and `service`, e.g.
 * * `{{project_id}}/{{service}}`
 * When using the `pulumi import` command, project services can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:projects/service:Service default {{project_id}}/{{service}}
 * ```
 * Note that unlike other resources that fail if they already exist,
 * `pulumi up` can be successfully used to verify already enabled services.
 * This means that when importing existing resources into Terraform, you can either
 * import the `google_project_service` resources or treat them as new
 * infrastructure and run `pulumi up` to add them to state.
 * @property checkIfServiceHasUsageOnDestroy Beta
 * If `true`, the usage of the service to be disabled will be checked and an error
 * will be returned if the service to be disabled has usage in last 30 days.
 * Defaults to `false`.
 * @property disableDependentServices If `true`, services that are enabled
 * and which depend on this service should also be disabled when this service is
 * destroyed. If `false` or unset, an error will be generated if any enabled
 * services depend on this service when destroying it.
 * @property disableOnDestroy
 * @property project The project ID. If not provided, the provider project
 * is used.
 * @property service The service to enable.
 */
public data class ServiceArgs(
    public val checkIfServiceHasUsageOnDestroy: Output? = null,
    public val disableDependentServices: Output? = null,
    public val disableOnDestroy: Output? = null,
    public val project: Output? = null,
    public val service: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.projects.ServiceArgs =
        com.pulumi.gcp.projects.ServiceArgs.builder()
            .checkIfServiceHasUsageOnDestroy(checkIfServiceHasUsageOnDestroy?.applyValue({ args0 -> args0 }))
            .disableDependentServices(disableDependentServices?.applyValue({ args0 -> args0 }))
            .disableOnDestroy(disableOnDestroy?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .service(service?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ServiceArgs].
 */
@PulumiTagMarker
public class ServiceArgsBuilder internal constructor() {
    private var checkIfServiceHasUsageOnDestroy: Output? = null

    private var disableDependentServices: Output? = null

    private var disableOnDestroy: Output? = null

    private var project: Output? = null

    private var service: Output? = null

    /**
     * @param value Beta
     * If `true`, the usage of the service to be disabled will be checked and an error
     * will be returned if the service to be disabled has usage in last 30 days.
     * Defaults to `false`.
     */
    @JvmName("xlshtqlhpdplllpd")
    public suspend fun checkIfServiceHasUsageOnDestroy(`value`: Output) {
        this.checkIfServiceHasUsageOnDestroy = value
    }

    /**
     * @param value If `true`, services that are enabled
     * and which depend on this service should also be disabled when this service is
     * destroyed. If `false` or unset, an error will be generated if any enabled
     * services depend on this service when destroying it.
     */
    @JvmName("dkudlsbnaeywqquh")
    public suspend fun disableDependentServices(`value`: Output) {
        this.disableDependentServices = value
    }

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

    /**
     * @param value The project ID. If not provided, the provider project
     * is used.
     */
    @JvmName("qcqurtsiuhqqrvjw")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The service to enable.
     */
    @JvmName("nbgrolcnaywwvxwi")
    public suspend fun service(`value`: Output) {
        this.service = value
    }

    /**
     * @param value Beta
     * If `true`, the usage of the service to be disabled will be checked and an error
     * will be returned if the service to be disabled has usage in last 30 days.
     * Defaults to `false`.
     */
    @JvmName("pqucevhtwrskfphn")
    public suspend fun checkIfServiceHasUsageOnDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.checkIfServiceHasUsageOnDestroy = mapped
    }

    /**
     * @param value If `true`, services that are enabled
     * and which depend on this service should also be disabled when this service is
     * destroyed. If `false` or unset, an error will be generated if any enabled
     * services depend on this service when destroying it.
     */
    @JvmName("uqtxrgeggsxgwdmg")
    public suspend fun disableDependentServices(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableDependentServices = mapped
    }

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

    /**
     * @param value The project ID. If not provided, the provider project
     * is used.
     */
    @JvmName("uiwaxodvupyosleb")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

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

    internal fun build(): ServiceArgs = ServiceArgs(
        checkIfServiceHasUsageOnDestroy = checkIfServiceHasUsageOnDestroy,
        disableDependentServices = disableDependentServices,
        disableOnDestroy = disableOnDestroy,
        project = project,
        service = service,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy