com.pulumi.azure.marketplace.kotlin.MarketplaceFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.marketplace.kotlin
import com.pulumi.azure.marketplace.MarketplaceFunctions.getAgreementPlain
import com.pulumi.azure.marketplace.kotlin.inputs.GetAgreementPlainArgs
import com.pulumi.azure.marketplace.kotlin.inputs.GetAgreementPlainArgsBuilder
import com.pulumi.azure.marketplace.kotlin.outputs.GetAgreementResult
import com.pulumi.azure.marketplace.kotlin.outputs.GetAgreementResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object MarketplaceFunctions {
/**
* Uses this data source to access information about an existing Marketplace Agreement.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const barracuda = azure.marketplace.getAgreement({
* publisher: "barracudanetworks",
* offer: "waf",
* plan: "hourly",
* });
* export const azurermMarketplaceAgreementId = id;
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* barracuda = azure.marketplace.get_agreement(publisher="barracudanetworks",
* offer="waf",
* plan="hourly")
* pulumi.export("azurermMarketplaceAgreementId", id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var barracuda = Azure.Marketplace.GetAgreement.Invoke(new()
* {
* Publisher = "barracudanetworks",
* Offer = "waf",
* Plan = "hourly",
* });
* return new Dictionary
* {
* ["azurermMarketplaceAgreementId"] = id,
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/marketplace"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := marketplace.LookupAgreement(ctx, &marketplace.LookupAgreementArgs{
* Publisher: "barracudanetworks",
* Offer: "waf",
* Plan: "hourly",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("azurermMarketplaceAgreementId", id)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.marketplace.MarketplaceFunctions;
* import com.pulumi.azure.marketplace.inputs.GetAgreementArgs;
* 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 barracuda = MarketplaceFunctions.getAgreement(GetAgreementArgs.builder()
* .publisher("barracudanetworks")
* .offer("waf")
* .plan("hourly")
* .build());
* ctx.export("azurermMarketplaceAgreementId", id);
* }
* }
* ```
* ```yaml
* variables:
* barracuda:
* fn::invoke:
* Function: azure:marketplace:getAgreement
* Arguments:
* publisher: barracudanetworks
* offer: waf
* plan: hourly
* outputs:
* azurermMarketplaceAgreementId: ${id}
* ```
*
* @param argument A collection of arguments for invoking getAgreement.
* @return A collection of values returned by getAgreement.
*/
public suspend fun getAgreement(argument: GetAgreementPlainArgs): GetAgreementResult =
toKotlin(getAgreementPlain(argument.toJava()).await())
/**
* @see [getAgreement].
* @param offer The Offer of the Marketplace Image.
* @param plan The Plan of the Marketplace Image.
* @param publisher The Publisher of the Marketplace Image.
* @return A collection of values returned by getAgreement.
*/
public suspend fun getAgreement(
offer: String,
plan: String,
publisher: String,
): GetAgreementResult {
val argument = GetAgreementPlainArgs(
offer = offer,
plan = plan,
publisher = publisher,
)
return toKotlin(getAgreementPlain(argument.toJava()).await())
}
/**
* @see [getAgreement].
* @param argument Builder for [com.pulumi.azure.marketplace.kotlin.inputs.GetAgreementPlainArgs].
* @return A collection of values returned by getAgreement.
*/
public suspend fun getAgreement(argument: suspend GetAgreementPlainArgsBuilder.() -> Unit): GetAgreementResult {
val builder = GetAgreementPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getAgreementPlain(builtArgument.toJava()).await())
}
}