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

com.pulumi.azurenative.media.inputs.ContentKeyPolicyTokenRestrictionArgs Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.azurenative.media.inputs;

import com.pulumi.azurenative.media.enums.ContentKeyPolicyRestrictionTokenType;
import com.pulumi.azurenative.media.inputs.ContentKeyPolicyRsaTokenKeyArgs;
import com.pulumi.azurenative.media.inputs.ContentKeyPolicySymmetricTokenKeyArgs;
import com.pulumi.azurenative.media.inputs.ContentKeyPolicyTokenClaimArgs;
import com.pulumi.azurenative.media.inputs.ContentKeyPolicyX509CertificateTokenKeyArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Represents a token restriction. Provided token must match these requirements for successful license or key delivery.
 * 
 */
public final class ContentKeyPolicyTokenRestrictionArgs extends com.pulumi.resources.ResourceArgs {

    public static final ContentKeyPolicyTokenRestrictionArgs Empty = new ContentKeyPolicyTokenRestrictionArgs();

    /**
     * A list of alternative verification keys.
     * 
     */
    @Import(name="alternateVerificationKeys")
    private @Nullable Output> alternateVerificationKeys;

    /**
     * @return A list of alternative verification keys.
     * 
     */
    public Optional>> alternateVerificationKeys() {
        return Optional.ofNullable(this.alternateVerificationKeys);
    }

    /**
     * The audience for the token.
     * 
     */
    @Import(name="audience", required=true)
    private Output audience;

    /**
     * @return The audience for the token.
     * 
     */
    public Output audience() {
        return this.audience;
    }

    /**
     * The token issuer.
     * 
     */
    @Import(name="issuer", required=true)
    private Output issuer;

    /**
     * @return The token issuer.
     * 
     */
    public Output issuer() {
        return this.issuer;
    }

    /**
     * The discriminator for derived types.
     * Expected value is '#Microsoft.Media.ContentKeyPolicyTokenRestriction'.
     * 
     */
    @Import(name="odataType", required=true)
    private Output odataType;

    /**
     * @return The discriminator for derived types.
     * Expected value is '#Microsoft.Media.ContentKeyPolicyTokenRestriction'.
     * 
     */
    public Output odataType() {
        return this.odataType;
    }

    /**
     * The OpenID connect discovery document.
     * 
     */
    @Import(name="openIdConnectDiscoveryDocument")
    private @Nullable Output openIdConnectDiscoveryDocument;

    /**
     * @return The OpenID connect discovery document.
     * 
     */
    public Optional> openIdConnectDiscoveryDocument() {
        return Optional.ofNullable(this.openIdConnectDiscoveryDocument);
    }

    /**
     * The primary verification key.
     * 
     */
    @Import(name="primaryVerificationKey", required=true)
    private Output primaryVerificationKey;

    /**
     * @return The primary verification key.
     * 
     */
    public Output primaryVerificationKey() {
        return this.primaryVerificationKey;
    }

    /**
     * A list of required token claims.
     * 
     */
    @Import(name="requiredClaims")
    private @Nullable Output> requiredClaims;

    /**
     * @return A list of required token claims.
     * 
     */
    public Optional>> requiredClaims() {
        return Optional.ofNullable(this.requiredClaims);
    }

    /**
     * The type of token.
     * 
     */
    @Import(name="restrictionTokenType", required=true)
    private Output> restrictionTokenType;

    /**
     * @return The type of token.
     * 
     */
    public Output> restrictionTokenType() {
        return this.restrictionTokenType;
    }

    private ContentKeyPolicyTokenRestrictionArgs() {}

    private ContentKeyPolicyTokenRestrictionArgs(ContentKeyPolicyTokenRestrictionArgs $) {
        this.alternateVerificationKeys = $.alternateVerificationKeys;
        this.audience = $.audience;
        this.issuer = $.issuer;
        this.odataType = $.odataType;
        this.openIdConnectDiscoveryDocument = $.openIdConnectDiscoveryDocument;
        this.primaryVerificationKey = $.primaryVerificationKey;
        this.requiredClaims = $.requiredClaims;
        this.restrictionTokenType = $.restrictionTokenType;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(ContentKeyPolicyTokenRestrictionArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private ContentKeyPolicyTokenRestrictionArgs $;

        public Builder() {
            $ = new ContentKeyPolicyTokenRestrictionArgs();
        }

        public Builder(ContentKeyPolicyTokenRestrictionArgs defaults) {
            $ = new ContentKeyPolicyTokenRestrictionArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param alternateVerificationKeys A list of alternative verification keys.
         * 
         * @return builder
         * 
         */
        public Builder alternateVerificationKeys(@Nullable Output> alternateVerificationKeys) {
            $.alternateVerificationKeys = alternateVerificationKeys;
            return this;
        }

        /**
         * @param alternateVerificationKeys A list of alternative verification keys.
         * 
         * @return builder
         * 
         */
        public Builder alternateVerificationKeys(List alternateVerificationKeys) {
            return alternateVerificationKeys(Output.of(alternateVerificationKeys));
        }

        /**
         * @param alternateVerificationKeys A list of alternative verification keys.
         * 
         * @return builder
         * 
         */
        public Builder alternateVerificationKeys(Object... alternateVerificationKeys) {
            return alternateVerificationKeys(List.of(alternateVerificationKeys));
        }

        /**
         * @param audience The audience for the token.
         * 
         * @return builder
         * 
         */
        public Builder audience(Output audience) {
            $.audience = audience;
            return this;
        }

        /**
         * @param audience The audience for the token.
         * 
         * @return builder
         * 
         */
        public Builder audience(String audience) {
            return audience(Output.of(audience));
        }

        /**
         * @param issuer The token issuer.
         * 
         * @return builder
         * 
         */
        public Builder issuer(Output issuer) {
            $.issuer = issuer;
            return this;
        }

        /**
         * @param issuer The token issuer.
         * 
         * @return builder
         * 
         */
        public Builder issuer(String issuer) {
            return issuer(Output.of(issuer));
        }

        /**
         * @param odataType The discriminator for derived types.
         * Expected value is '#Microsoft.Media.ContentKeyPolicyTokenRestriction'.
         * 
         * @return builder
         * 
         */
        public Builder odataType(Output odataType) {
            $.odataType = odataType;
            return this;
        }

        /**
         * @param odataType The discriminator for derived types.
         * Expected value is '#Microsoft.Media.ContentKeyPolicyTokenRestriction'.
         * 
         * @return builder
         * 
         */
        public Builder odataType(String odataType) {
            return odataType(Output.of(odataType));
        }

        /**
         * @param openIdConnectDiscoveryDocument The OpenID connect discovery document.
         * 
         * @return builder
         * 
         */
        public Builder openIdConnectDiscoveryDocument(@Nullable Output openIdConnectDiscoveryDocument) {
            $.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument;
            return this;
        }

        /**
         * @param openIdConnectDiscoveryDocument The OpenID connect discovery document.
         * 
         * @return builder
         * 
         */
        public Builder openIdConnectDiscoveryDocument(String openIdConnectDiscoveryDocument) {
            return openIdConnectDiscoveryDocument(Output.of(openIdConnectDiscoveryDocument));
        }

        /**
         * @param primaryVerificationKey The primary verification key.
         * 
         * @return builder
         * 
         */
        public Builder primaryVerificationKey(Output primaryVerificationKey) {
            $.primaryVerificationKey = primaryVerificationKey;
            return this;
        }

        /**
         * @param primaryVerificationKey The primary verification key.
         * 
         * @return builder
         * 
         */
        public Builder primaryVerificationKey(Object primaryVerificationKey) {
            return primaryVerificationKey(Output.of(primaryVerificationKey));
        }

        /**
         * @param requiredClaims A list of required token claims.
         * 
         * @return builder
         * 
         */
        public Builder requiredClaims(@Nullable Output> requiredClaims) {
            $.requiredClaims = requiredClaims;
            return this;
        }

        /**
         * @param requiredClaims A list of required token claims.
         * 
         * @return builder
         * 
         */
        public Builder requiredClaims(List requiredClaims) {
            return requiredClaims(Output.of(requiredClaims));
        }

        /**
         * @param requiredClaims A list of required token claims.
         * 
         * @return builder
         * 
         */
        public Builder requiredClaims(ContentKeyPolicyTokenClaimArgs... requiredClaims) {
            return requiredClaims(List.of(requiredClaims));
        }

        /**
         * @param restrictionTokenType The type of token.
         * 
         * @return builder
         * 
         */
        public Builder restrictionTokenType(Output> restrictionTokenType) {
            $.restrictionTokenType = restrictionTokenType;
            return this;
        }

        /**
         * @param restrictionTokenType The type of token.
         * 
         * @return builder
         * 
         */
        public Builder restrictionTokenType(Either restrictionTokenType) {
            return restrictionTokenType(Output.of(restrictionTokenType));
        }

        /**
         * @param restrictionTokenType The type of token.
         * 
         * @return builder
         * 
         */
        public Builder restrictionTokenType(String restrictionTokenType) {
            return restrictionTokenType(Either.ofLeft(restrictionTokenType));
        }

        /**
         * @param restrictionTokenType The type of token.
         * 
         * @return builder
         * 
         */
        public Builder restrictionTokenType(ContentKeyPolicyRestrictionTokenType restrictionTokenType) {
            return restrictionTokenType(Either.ofRight(restrictionTokenType));
        }

        public ContentKeyPolicyTokenRestrictionArgs build() {
            if ($.audience == null) {
                throw new MissingRequiredPropertyException("ContentKeyPolicyTokenRestrictionArgs", "audience");
            }
            if ($.issuer == null) {
                throw new MissingRequiredPropertyException("ContentKeyPolicyTokenRestrictionArgs", "issuer");
            }
            $.odataType = Codegen.stringProp("odataType").output().arg($.odataType).require();
            if ($.primaryVerificationKey == null) {
                throw new MissingRequiredPropertyException("ContentKeyPolicyTokenRestrictionArgs", "primaryVerificationKey");
            }
            if ($.restrictionTokenType == null) {
                throw new MissingRequiredPropertyException("ContentKeyPolicyTokenRestrictionArgs", "restrictionTokenType");
            }
            return $;
        }
    }

}