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

com.pulumi.azuread.Invitation Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azuread;

import com.pulumi.azuread.InvitationArgs;
import com.pulumi.azuread.Utilities;
import com.pulumi.azuread.inputs.InvitationState;
import com.pulumi.azuread.outputs.InvitationMessage;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an invitation of a guest user within Azure Active Directory.
 * 
 * ## API Permissions
 * 
 * The following API permissions are required in order to use this resource.
 * 
 * When authenticated with a service principal, this resource requires one of the following application roles: `User.Invite.All`, `User.ReadWrite.All` or `Directory.ReadWrite.All`
 * 
 * When authenticated with a user principal, this resource requires one of the following directory roles: `Guest Inviter`, `User Administrator` or `Global Administrator`
 * 
 * ## Example Usage
 * 
 * *Basic example*
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azuread.Invitation;
 * import com.pulumi.azuread.InvitationArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var example = new Invitation("example", InvitationArgs.builder()
 *             .userEmailAddress("jdoe}{@literal @}{@code example.com")
 *             .redirectUrl("https://portal.azure.com")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * *Invitation with standard message* * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azuread.Invitation;
 * import com.pulumi.azuread.InvitationArgs;
 * import com.pulumi.azuread.inputs.InvitationMessageArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var example = new Invitation("example", InvitationArgs.builder()
 *             .userEmailAddress("jdoe}{@literal @}{@code example.com")
 *             .redirectUrl("https://portal.azure.com")
 *             .message(InvitationMessageArgs.builder()
 *                 .language("en-US")
 *                 .build())
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * *Invitation with custom message body and an additional recipient* * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azuread.Invitation;
 * import com.pulumi.azuread.InvitationArgs;
 * import com.pulumi.azuread.inputs.InvitationMessageArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var example = new Invitation("example", InvitationArgs.builder()
 *             .userDisplayName("Bob Bobson")
 *             .userEmailAddress("bbobson}{@literal @}{@code example.com")
 *             .redirectUrl("https://portal.azure.com")
 *             .message(InvitationMessageArgs.builder()
 *                 .additionalRecipients("aaliceberg}{@literal @}{@code example.com")
 *                 .body("Hello there! You are invited to join my Azure tenant!")
 *                 .build())
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * This resource does not support importing. * */ @ResourceType(type="azuread:index/invitation:Invitation") public class Invitation extends com.pulumi.resources.CustomResource { /** * A `message` block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent. * */ @Export(name="message", refs={InvitationMessage.class}, tree="[0]") private Output message; /** * @return A `message` block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent. * */ public Output> message() { return Codegen.optional(this.message); } /** * The URL the user can use to redeem their invitation. * */ @Export(name="redeemUrl", refs={String.class}, tree="[0]") private Output redeemUrl; /** * @return The URL the user can use to redeem their invitation. * */ public Output redeemUrl() { return this.redeemUrl; } /** * The URL that the user should be redirected to once the invitation is redeemed. * */ @Export(name="redirectUrl", refs={String.class}, tree="[0]") private Output redirectUrl; /** * @return The URL that the user should be redirected to once the invitation is redeemed. * */ public Output redirectUrl() { return this.redirectUrl; } /** * The display name of the user being invited. * */ @Export(name="userDisplayName", refs={String.class}, tree="[0]") private Output userDisplayName; /** * @return The display name of the user being invited. * */ public Output> userDisplayName() { return Codegen.optional(this.userDisplayName); } /** * The email address of the user being invited. * */ @Export(name="userEmailAddress", refs={String.class}, tree="[0]") private Output userEmailAddress; /** * @return The email address of the user being invited. * */ public Output userEmailAddress() { return this.userEmailAddress; } /** * Object ID of the invited user. * */ @Export(name="userId", refs={String.class}, tree="[0]") private Output userId; /** * @return Object ID of the invited user. * */ public Output userId() { return this.userId; } /** * The user type of the user being invited. Must be one of `Guest` or `Member`. Only Global Administrators can invite users as members. Defaults to `Guest`. * */ @Export(name="userType", refs={String.class}, tree="[0]") private Output userType; /** * @return The user type of the user being invited. Must be one of `Guest` or `Member`. Only Global Administrators can invite users as members. Defaults to `Guest`. * */ public Output> userType() { return Codegen.optional(this.userType); } /** * * @param name The _unique_ name of the resulting resource. */ public Invitation(java.lang.String name) { this(name, InvitationArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Invitation(java.lang.String name, InvitationArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public Invitation(java.lang.String name, InvitationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azuread:index/invitation:Invitation", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Invitation(java.lang.String name, Output id, @Nullable InvitationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azuread:index/invitation:Invitation", name, state, makeResourceOptions(options, id), false); } private static InvitationArgs makeArgs(InvitationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? InvitationArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static Invitation get(java.lang.String name, Output id, @Nullable InvitationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Invitation(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy