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

com.pulumi.azurenative.apimanagement.kotlin.SubscriptionArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.apimanagement.kotlin

import com.pulumi.azurenative.apimanagement.SubscriptionArgs.builder
import com.pulumi.azurenative.apimanagement.kotlin.enums.SubscriptionState
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Subscription details.
 * Azure REST API version: 2022-08-01. Prior API version in Azure Native 1.x: 2020-12-01.
 * Other available API versions: 2016-07-07, 2016-10-10, 2018-01-01, 2019-01-01, 2022-09-01-preview, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01.
 * ## Example Usage
 * ### ApiManagementCreateSubscription
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var subscription = new AzureNative.ApiManagement.Subscription("subscription", new()
 *     {
 *         DisplayName = "testsub",
 *         OwnerId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7",
 *         ResourceGroupName = "rg1",
 *         Scope = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002",
 *         ServiceName = "apimService1",
 *         Sid = "testsub",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := apimanagement.NewSubscription(ctx, "subscription", &apimanagement.SubscriptionArgs{
 * 			DisplayName:       pulumi.String("testsub"),
 * 			OwnerId:           pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7"),
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 			Scope:             pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
 * 			ServiceName:       pulumi.String("apimService1"),
 * 			Sid:               pulumi.String("testsub"),
 * 		})
 * 		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.apimanagement.Subscription;
 * import com.pulumi.azurenative.apimanagement.SubscriptionArgs;
 * 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 subscription = new Subscription("subscription", SubscriptionArgs.builder()
 *             .displayName("testsub")
 *             .ownerId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7")
 *             .resourceGroupName("rg1")
 *             .scope("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002")
 *             .serviceName("apimService1")
 *             .sid("testsub")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:apimanagement:Subscription testsub /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}
 * ```
 * @property allowTracing Determines whether tracing can be enabled
 * @property appType Determines the type of application which send the create user request. Default is legacy publisher portal.
 * @property displayName Subscription name.
 * @property notify Notify change in Subscription State.
 *  - If false, do not send any email notification for change of state of subscription
 *  - If true, send email notification of change of state of subscription
 * @property ownerId User (user id path) for whom subscription is being created in form /users/{userId}
 * @property primaryKey Primary subscription key. If not specified during request key will be generated automatically.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property scope Scope like /products/{productId} or /apis or /apis/{apiId}.
 * @property secondaryKey Secondary subscription key. If not specified during request key will be generated automatically.
 * @property serviceName The name of the API Management service.
 * @property sid Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
 * @property state Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
 */
public data class SubscriptionArgs(
    public val allowTracing: Output? = null,
    public val appType: Output? = null,
    public val displayName: Output? = null,
    public val notify: Output? = null,
    public val ownerId: Output? = null,
    public val primaryKey: Output? = null,
    public val resourceGroupName: Output? = null,
    public val scope: Output? = null,
    public val secondaryKey: Output? = null,
    public val serviceName: Output? = null,
    public val sid: Output? = null,
    public val state: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.apimanagement.SubscriptionArgs =
        com.pulumi.azurenative.apimanagement.SubscriptionArgs.builder()
            .allowTracing(allowTracing?.applyValue({ args0 -> args0 }))
            .appType(appType?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .notify_(notify?.applyValue({ args0 -> args0 }))
            .ownerId(ownerId?.applyValue({ args0 -> args0 }))
            .primaryKey(primaryKey?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .secondaryKey(secondaryKey?.applyValue({ args0 -> args0 }))
            .serviceName(serviceName?.applyValue({ args0 -> args0 }))
            .sid(sid?.applyValue({ args0 -> args0 }))
            .state(state?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [SubscriptionArgs].
 */
@PulumiTagMarker
public class SubscriptionArgsBuilder internal constructor() {
    private var allowTracing: Output? = null

    private var appType: Output? = null

    private var displayName: Output? = null

    private var notify: Output? = null

    private var ownerId: Output? = null

    private var primaryKey: Output? = null

    private var resourceGroupName: Output? = null

    private var scope: Output? = null

    private var secondaryKey: Output? = null

    private var serviceName: Output? = null

    private var sid: Output? = null

    private var state: Output? = null

    /**
     * @param value Determines whether tracing can be enabled
     */
    @JvmName("pkmcxfldwoprimbq")
    public suspend fun allowTracing(`value`: Output) {
        this.allowTracing = value
    }

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy publisher portal.
     */
    @JvmName("efatqxrpcwivrkxs")
    public suspend fun appType(`value`: Output) {
        this.appType = value
    }

    /**
     * @param value Subscription name.
     */
    @JvmName("nmawuiauxhelnksm")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Notify change in Subscription State.
     *  - If false, do not send any email notification for change of state of subscription
     *  - If true, send email notification of change of state of subscription
     */
    @JvmName("jcradgiygequmqsk")
    public suspend fun notify(`value`: Output) {
        this.notify = value
    }

    /**
     * @param value User (user id path) for whom subscription is being created in form /users/{userId}
     */
    @JvmName("stpuphfhhppnupwi")
    public suspend fun ownerId(`value`: Output) {
        this.ownerId = value
    }

    /**
     * @param value Primary subscription key. If not specified during request key will be generated automatically.
     */
    @JvmName("llbabsqbhdyhapls")
    public suspend fun primaryKey(`value`: Output) {
        this.primaryKey = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("kendqhvmcxucoqkj")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Scope like /products/{productId} or /apis or /apis/{apiId}.
     */
    @JvmName("ymmbpwhbjballfjt")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value Secondary subscription key. If not specified during request key will be generated automatically.
     */
    @JvmName("byajcuyibsgmciho")
    public suspend fun secondaryKey(`value`: Output) {
        this.secondaryKey = value
    }

    /**
     * @param value The name of the API Management service.
     */
    @JvmName("oobjlnpsgqfbfvpt")
    public suspend fun serviceName(`value`: Output) {
        this.serviceName = value
    }

    /**
     * @param value Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
     */
    @JvmName("revrdksdtyuykbjq")
    public suspend fun sid(`value`: Output) {
        this.sid = value
    }

    /**
     * @param value Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
     */
    @JvmName("gcqjgmpcidogcfvk")
    public suspend fun state(`value`: Output) {
        this.state = value
    }

    /**
     * @param value Determines whether tracing can be enabled
     */
    @JvmName("hdmotnchuxfgwrfi")
    public suspend fun allowTracing(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowTracing = mapped
    }

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy publisher portal.
     */
    @JvmName("hopuineyucweknid")
    public suspend fun appType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appType = mapped
    }

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

    /**
     * @param value Notify change in Subscription State.
     *  - If false, do not send any email notification for change of state of subscription
     *  - If true, send email notification of change of state of subscription
     */
    @JvmName("sbepvyfnyeteqjkh")
    public suspend fun notify(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notify = mapped
    }

    /**
     * @param value User (user id path) for whom subscription is being created in form /users/{userId}
     */
    @JvmName("ayjadnmtkpotfpvl")
    public suspend fun ownerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ownerId = mapped
    }

    /**
     * @param value Primary subscription key. If not specified during request key will be generated automatically.
     */
    @JvmName("pvvvyjlrntbxjknp")
    public suspend fun primaryKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.primaryKey = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("lqpqfiymsxaujnes")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Scope like /products/{productId} or /apis or /apis/{apiId}.
     */
    @JvmName("cosakivykgnsgran")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value Secondary subscription key. If not specified during request key will be generated automatically.
     */
    @JvmName("wfinhqtwflguttja")
    public suspend fun secondaryKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryKey = mapped
    }

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

    /**
     * @param value Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
     */
    @JvmName("mjfiofpccljugabu")
    public suspend fun sid(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sid = mapped
    }

    /**
     * @param value Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
     */
    @JvmName("oitfycutnyyflaoa")
    public suspend fun state(`value`: SubscriptionState?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.state = mapped
    }

    internal fun build(): SubscriptionArgs = SubscriptionArgs(
        allowTracing = allowTracing,
        appType = appType,
        displayName = displayName,
        notify = notify,
        ownerId = ownerId,
        primaryKey = primaryKey,
        resourceGroupName = resourceGroupName,
        scope = scope,
        secondaryKey = secondaryKey,
        serviceName = serviceName,
        sid = sid,
        state = state,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy