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

com.pulumi.azure.apimanagement.kotlin.ProductPolicyArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.apimanagement.kotlin

import com.pulumi.azure.apimanagement.ProductPolicyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages an API Management Product Policy
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = azure.apimanagement.getProduct({
 *     productId: "my-product",
 *     apiManagementName: "example-apim",
 *     resourceGroupName: "search-service",
 * });
 * const exampleProductPolicy = new azure.apimanagement.ProductPolicy("example", {
 *     productId: example.then(example => example.productId),
 *     apiManagementName: example.then(example => example.apiManagementName),
 *     resourceGroupName: example.then(example => example.resourceGroupName),
 *     xmlContent: `
 *   
 *     
 *   
 * 
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.apimanagement.get_product(product_id="my-product",
 *     api_management_name="example-apim",
 *     resource_group_name="search-service")
 * example_product_policy = azure.apimanagement.ProductPolicy("example",
 *     product_id=example.product_id,
 *     api_management_name=example.api_management_name,
 *     resource_group_name=example.resource_group_name,
 *     xml_content="""
 *   
 *     
 *   
 * 
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = Azure.ApiManagement.GetProduct.Invoke(new()
 *     {
 *         ProductId = "my-product",
 *         ApiManagementName = "example-apim",
 *         ResourceGroupName = "search-service",
 *     });
 *     var exampleProductPolicy = new Azure.ApiManagement.ProductPolicy("example", new()
 *     {
 *         ProductId = example.Apply(getProductResult => getProductResult.ProductId),
 *         ApiManagementName = example.Apply(getProductResult => getProductResult.ApiManagementName),
 *         ResourceGroupName = example.Apply(getProductResult => getProductResult.ResourceGroupName),
 *         XmlContent = @"
 *   
 *     
 *   
 * 
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{
 * 			ProductId:         "my-product",
 * 			ApiManagementName: "example-apim",
 * 			ResourceGroupName: "search-service",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewProductPolicy(ctx, "example", &apimanagement.ProductPolicyArgs{
 * 			ProductId:         pulumi.String(example.ProductId),
 * 			ApiManagementName: pulumi.String(example.ApiManagementName),
 * 			ResourceGroupName: pulumi.String(example.ResourceGroupName),
 * 			XmlContent: pulumi.String(`
 *   
 *     
 *   
 * 
 * `),
 * 		})
 * 		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.azure.apimanagement.ApimanagementFunctions;
 * import com.pulumi.azure.apimanagement.inputs.GetProductArgs;
 * import com.pulumi.azure.apimanagement.ProductPolicy;
 * import com.pulumi.azure.apimanagement.ProductPolicyArgs;
 * 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) {
 *         final var example = ApimanagementFunctions.getProduct(GetProductArgs.builder()
 *             .productId("my-product")
 *             .apiManagementName("example-apim")
 *             .resourceGroupName("search-service")
 *             .build());
 *         var exampleProductPolicy = new ProductPolicy("exampleProductPolicy", ProductPolicyArgs.builder()
 *             .productId(example.applyValue(getProductResult -> getProductResult.productId()))
 *             .apiManagementName(example.applyValue(getProductResult -> getProductResult.apiManagementName()))
 *             .resourceGroupName(example.applyValue(getProductResult -> getProductResult.resourceGroupName()))
 *             .xmlContent("""
 * 
 *   
 *     
 *   
 * 
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleProductPolicy:
 *     type: azure:apimanagement:ProductPolicy
 *     name: example
 *     properties:
 *       productId: ${example.productId}
 *       apiManagementName: ${example.apiManagementName}
 *       resourceGroupName: ${example.resourceGroupName}
 *       xmlContent: |
 *         
 *           
 *             
 *           
 *         
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:apimanagement:getProduct
 *       Arguments:
 *         productId: my-product
 *         apiManagementName: example-apim
 *         resourceGroupName: search-service
 * ```
 * 
 * ## Import
 * API Management Product Policy can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:apimanagement/productPolicy:ProductPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/products/product1
 * ```
 * @property apiManagementName The name of the API Management Service. Changing this forces a new resource to be created.
 * @property productId The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
 * @property xmlContent The XML Content for this Policy.
 * @property xmlLink A link to a Policy XML Document, which must be publicly available.
 */
public data class ProductPolicyArgs(
    public val apiManagementName: Output? = null,
    public val productId: Output? = null,
    public val resourceGroupName: Output? = null,
    public val xmlContent: Output? = null,
    public val xmlLink: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.apimanagement.ProductPolicyArgs =
        com.pulumi.azure.apimanagement.ProductPolicyArgs.builder()
            .apiManagementName(apiManagementName?.applyValue({ args0 -> args0 }))
            .productId(productId?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .xmlContent(xmlContent?.applyValue({ args0 -> args0 }))
            .xmlLink(xmlLink?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProductPolicyArgs].
 */
@PulumiTagMarker
public class ProductPolicyArgsBuilder internal constructor() {
    private var apiManagementName: Output? = null

    private var productId: Output? = null

    private var resourceGroupName: Output? = null

    private var xmlContent: Output? = null

    private var xmlLink: Output? = null

    /**
     * @param value The name of the API Management Service. Changing this forces a new resource to be created.
     */
    @JvmName("clrlotvpsbfafioi")
    public suspend fun apiManagementName(`value`: Output) {
        this.apiManagementName = value
    }

    /**
     * @param value The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
     */
    @JvmName("vxyggqtribfyswsb")
    public suspend fun productId(`value`: Output) {
        this.productId = value
    }

    /**
     * @param value The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("jljdigivjtbkdkpi")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The XML Content for this Policy.
     */
    @JvmName("woegnxjwhqbhrbhs")
    public suspend fun xmlContent(`value`: Output) {
        this.xmlContent = value
    }

    /**
     * @param value A link to a Policy XML Document, which must be publicly available.
     */
    @JvmName("walvpxqbtiagfgvh")
    public suspend fun xmlLink(`value`: Output) {
        this.xmlLink = value
    }

    /**
     * @param value The name of the API Management Service. Changing this forces a new resource to be created.
     */
    @JvmName("tsyykyxttaqibywh")
    public suspend fun apiManagementName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiManagementName = mapped
    }

    /**
     * @param value The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
     */
    @JvmName("dtxacyjutujtbwlx")
    public suspend fun productId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.productId = mapped
    }

    /**
     * @param value The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("kcrvvuvhvsamqbeh")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The XML Content for this Policy.
     */
    @JvmName("vtfjvrylyropatvq")
    public suspend fun xmlContent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.xmlContent = mapped
    }

    /**
     * @param value A link to a Policy XML Document, which must be publicly available.
     */
    @JvmName("iqwefvoaqsmyiwcw")
    public suspend fun xmlLink(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.xmlLink = mapped
    }

    internal fun build(): ProductPolicyArgs = ProductPolicyArgs(
        apiManagementName = apiManagementName,
        productId = productId,
        resourceGroupName = resourceGroupName,
        xmlContent = xmlContent,
        xmlLink = xmlLink,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy