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

com.pulumi.gitlab.kotlin.ServiceEmailsOnPush.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.4.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gitlab.kotlin

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.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: ServiceEmailsOnPushArgs = ServiceEmailsOnPushArgs()

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

/**
 * The `gitlab.ServiceEmailsOnPush` resource allows to manage the lifecycle of a project integration with Emails on Push Service.
 * > This resource is deprecated. Please use `gitlab.IntegrationEmailsOnPush` instead!
 * **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/integrations.html#emails-on-push)
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gitlab from "@pulumi/gitlab";
 * const awesomeProject = new gitlab.Project("awesome_project", {
 *     name: "awesome_project",
 *     description: "My awesome project.",
 *     visibilityLevel: "public",
 * });
 * const emails = new gitlab.ServiceEmailsOnPush("emails", {
 *     project: awesomeProject.id,
 *     recipients: "[email protected] [email protected]",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gitlab as gitlab
 * awesome_project = gitlab.Project("awesome_project",
 *     name="awesome_project",
 *     description="My awesome project.",
 *     visibility_level="public")
 * emails = gitlab.ServiceEmailsOnPush("emails",
 *     project=awesome_project.id,
 *     recipients="[email protected] [email protected]")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using GitLab = Pulumi.GitLab;
 * return await Deployment.RunAsync(() =>
 * {
 *     var awesomeProject = new GitLab.Project("awesome_project", new()
 *     {
 *         Name = "awesome_project",
 *         Description = "My awesome project.",
 *         VisibilityLevel = "public",
 *     });
 *     var emails = new GitLab.ServiceEmailsOnPush("emails", new()
 *     {
 *         Project = awesomeProject.Id,
 *         Recipients = "[email protected] [email protected]",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		awesomeProject, err := gitlab.NewProject(ctx, "awesome_project", &gitlab.ProjectArgs{
 * 			Name:            pulumi.String("awesome_project"),
 * 			Description:     pulumi.String("My awesome project."),
 * 			VisibilityLevel: pulumi.String("public"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = gitlab.NewServiceEmailsOnPush(ctx, "emails", &gitlab.ServiceEmailsOnPushArgs{
 * 			Project:    awesomeProject.ID(),
 * 			Recipients: pulumi.String("[email protected] [email protected]"),
 * 		})
 * 		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.gitlab.Project;
 * import com.pulumi.gitlab.ProjectArgs;
 * import com.pulumi.gitlab.ServiceEmailsOnPush;
 * import com.pulumi.gitlab.ServiceEmailsOnPushArgs;
 * 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 awesomeProject = new Project("awesomeProject", ProjectArgs.builder()
 *             .name("awesome_project")
 *             .description("My awesome project.")
 *             .visibilityLevel("public")
 *             .build());
 *         var emails = new ServiceEmailsOnPush("emails", ServiceEmailsOnPushArgs.builder()
 *             .project(awesomeProject.id())
 *             .recipients("[email protected] [email protected]")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   awesomeProject:
 *     type: gitlab:Project
 *     name: awesome_project
 *     properties:
 *       name: awesome_project
 *       description: My awesome project.
 *       visibilityLevel: public
 *   emails:
 *     type: gitlab:ServiceEmailsOnPush
 *     properties:
 *       project: ${awesomeProject.id}
 *       recipients: [email protected] [email protected]
 * ```
 * 
 * ## Import
 * You can import a gitlab_service_emails_on_push state using the project ID, e.g.
 * ```sh
 * $ pulumi import gitlab:index/serviceEmailsOnPush:ServiceEmailsOnPush emails 1
 * ```
 */
public class ServiceEmailsOnPush internal constructor(
    override val javaResource: com.pulumi.gitlab.ServiceEmailsOnPush,
) : KotlinCustomResource(javaResource, ServiceEmailsOnPushMapper) {
    /**
     * Whether the integration is active.
     */
    public val active: Output
        get() = javaResource.active().applyValue({ args0 -> args0 })

    /**
     * Branches to send notifications for. Valid options are `all`, `default`, `protected`, `default_and_protected`. Notifications are always fired for tag pushes.
     */
    public val branchesToBeNotified: Output?
        get() = javaResource.branchesToBeNotified().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ISO8601 date/time that this integration was activated at in UTC.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    /**
     * Disable code diffs.
     */
    public val disableDiffs: Output?
        get() = javaResource.disableDiffs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * ID or full-path of the project you want to activate integration on.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Enable notifications for push events.
     */
    public val pushEvents: Output?
        get() = javaResource.pushEvents().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Emails separated by whitespace.
     */
    public val recipients: Output
        get() = javaResource.recipients().applyValue({ args0 -> args0 })

    /**
     * Send from committer.
     */
    public val sendFromCommitterEmail: Output?
        get() = javaResource.sendFromCommitterEmail().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the integration in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
     */
    public val slug: Output
        get() = javaResource.slug().applyValue({ args0 -> args0 })

    /**
     * Enable notifications for tag push events.
     */
    public val tagPushEvents: Output?
        get() = javaResource.tagPushEvents().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The ISO8601 date/time that this integration was last updated at in UTC.
     */
    public val updatedAt: Output
        get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}

public object ServiceEmailsOnPushMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gitlab.ServiceEmailsOnPush::class == javaResource::class

    override fun map(javaResource: Resource): ServiceEmailsOnPush = ServiceEmailsOnPush(
        javaResource
            as com.pulumi.gitlab.ServiceEmailsOnPush,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy