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

com.pulumi.azure.apimanagement.SubscriptionArgs 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.azure.apimanagement;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class SubscriptionArgs extends com.pulumi.resources.ResourceArgs {

    public static final SubscriptionArgs Empty = new SubscriptionArgs();

    /**
     * Determines whether tracing can be enabled. Defaults to `true`.
     * 
     */
    @Import(name="allowTracing")
    private @Nullable Output allowTracing;

    /**
     * @return Determines whether tracing can be enabled. Defaults to `true`.
     * 
     */
    public Optional> allowTracing() {
        return Optional.ofNullable(this.allowTracing);
    }

    /**
     * The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `/apis` scope is used for the subscription and all apis are accessible.
     * 
     */
    @Import(name="apiId")
    private @Nullable Output apiId;

    /**
     * @return The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `/apis` scope is used for the subscription and all apis are accessible.
     * 
     */
    public Optional> apiId() {
        return Optional.ofNullable(this.apiId);
    }

    /**
     * The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="apiManagementName", required=true)
    private Output apiManagementName;

    /**
     * @return The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
     * 
     */
    public Output apiManagementName() {
        return this.apiManagementName;
    }

    /**
     * The display name of this Subscription.
     * 
     */
    @Import(name="displayName", required=true)
    private Output displayName;

    /**
     * @return The display name of this Subscription.
     * 
     */
    public Output displayName() {
        return this.displayName;
    }

    /**
     * The primary subscription key to use for the subscription.
     * 
     */
    @Import(name="primaryKey")
    private @Nullable Output primaryKey;

    /**
     * @return The primary subscription key to use for the subscription.
     * 
     */
    public Optional> primaryKey() {
        return Optional.ofNullable(this.primaryKey);
    }

    /**
     * The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `all_apis` scope is used for the subscription.
     * 
     */
    @Import(name="productId")
    private @Nullable Output productId;

    /**
     * @return The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `all_apis` scope is used for the subscription.
     * 
     */
    public Optional> productId() {
        return Optional.ofNullable(this.productId);
    }

    /**
     * The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * The secondary subscription key to use for the subscription.
     * 
     */
    @Import(name="secondaryKey")
    private @Nullable Output secondaryKey;

    /**
     * @return The secondary subscription key to use for the subscription.
     * 
     */
    public Optional> secondaryKey() {
        return Optional.ofNullable(this.secondaryKey);
    }

    /**
     * The state of this Subscription. Possible values are `active`, `cancelled`, `expired`, `rejected`, `submitted` and `suspended`. Defaults to `submitted`.
     * 
     */
    @Import(name="state")
    private @Nullable Output state;

    /**
     * @return The state of this Subscription. Possible values are `active`, `cancelled`, `expired`, `rejected`, `submitted` and `suspended`. Defaults to `submitted`.
     * 
     */
    public Optional> state() {
        return Optional.ofNullable(this.state);
    }

    /**
     * An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="subscriptionId")
    private @Nullable Output subscriptionId;

    /**
     * @return An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
     * 
     */
    public Optional> subscriptionId() {
        return Optional.ofNullable(this.subscriptionId);
    }

    /**
     * The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="userId")
    private @Nullable Output userId;

    /**
     * @return The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
     * 
     */
    public Optional> userId() {
        return Optional.ofNullable(this.userId);
    }

    private SubscriptionArgs() {}

    private SubscriptionArgs(SubscriptionArgs $) {
        this.allowTracing = $.allowTracing;
        this.apiId = $.apiId;
        this.apiManagementName = $.apiManagementName;
        this.displayName = $.displayName;
        this.primaryKey = $.primaryKey;
        this.productId = $.productId;
        this.resourceGroupName = $.resourceGroupName;
        this.secondaryKey = $.secondaryKey;
        this.state = $.state;
        this.subscriptionId = $.subscriptionId;
        this.userId = $.userId;
    }

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

    public static final class Builder {
        private SubscriptionArgs $;

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

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

        /**
         * @param allowTracing Determines whether tracing can be enabled. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder allowTracing(@Nullable Output allowTracing) {
            $.allowTracing = allowTracing;
            return this;
        }

        /**
         * @param allowTracing Determines whether tracing can be enabled. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder allowTracing(Boolean allowTracing) {
            return allowTracing(Output.of(allowTracing));
        }

        /**
         * @param apiId The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `/apis` scope is used for the subscription and all apis are accessible.
         * 
         * @return builder
         * 
         */
        public Builder apiId(@Nullable Output apiId) {
            $.apiId = apiId;
            return this;
        }

        /**
         * @param apiId The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `/apis` scope is used for the subscription and all apis are accessible.
         * 
         * @return builder
         * 
         */
        public Builder apiId(String apiId) {
            return apiId(Output.of(apiId));
        }

        /**
         * @param apiManagementName The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder apiManagementName(Output apiManagementName) {
            $.apiManagementName = apiManagementName;
            return this;
        }

        /**
         * @param apiManagementName The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder apiManagementName(String apiManagementName) {
            return apiManagementName(Output.of(apiManagementName));
        }

        /**
         * @param displayName The display name of this Subscription.
         * 
         * @return builder
         * 
         */
        public Builder displayName(Output displayName) {
            $.displayName = displayName;
            return this;
        }

        /**
         * @param displayName The display name of this Subscription.
         * 
         * @return builder
         * 
         */
        public Builder displayName(String displayName) {
            return displayName(Output.of(displayName));
        }

        /**
         * @param primaryKey The primary subscription key to use for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder primaryKey(@Nullable Output primaryKey) {
            $.primaryKey = primaryKey;
            return this;
        }

        /**
         * @param primaryKey The primary subscription key to use for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder primaryKey(String primaryKey) {
            return primaryKey(Output.of(primaryKey));
        }

        /**
         * @param productId The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `all_apis` scope is used for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder productId(@Nullable Output productId) {
            $.productId = productId;
            return this;
        }

        /**
         * @param productId The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * > **Info:** Only one of `product_id` and `api_id` can be set. If both are missing `all_apis` scope is used for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder productId(String productId) {
            return productId(Output.of(productId));
        }

        /**
         * @param resourceGroupName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param secondaryKey The secondary subscription key to use for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder secondaryKey(@Nullable Output secondaryKey) {
            $.secondaryKey = secondaryKey;
            return this;
        }

        /**
         * @param secondaryKey The secondary subscription key to use for the subscription.
         * 
         * @return builder
         * 
         */
        public Builder secondaryKey(String secondaryKey) {
            return secondaryKey(Output.of(secondaryKey));
        }

        /**
         * @param state The state of this Subscription. Possible values are `active`, `cancelled`, `expired`, `rejected`, `submitted` and `suspended`. Defaults to `submitted`.
         * 
         * @return builder
         * 
         */
        public Builder state(@Nullable Output state) {
            $.state = state;
            return this;
        }

        /**
         * @param state The state of this Subscription. Possible values are `active`, `cancelled`, `expired`, `rejected`, `submitted` and `suspended`. Defaults to `submitted`.
         * 
         * @return builder
         * 
         */
        public Builder state(String state) {
            return state(Output.of(state));
        }

        /**
         * @param subscriptionId An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder subscriptionId(@Nullable Output subscriptionId) {
            $.subscriptionId = subscriptionId;
            return this;
        }

        /**
         * @param subscriptionId An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder subscriptionId(String subscriptionId) {
            return subscriptionId(Output.of(subscriptionId));
        }

        /**
         * @param userId The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder userId(@Nullable Output userId) {
            $.userId = userId;
            return this;
        }

        /**
         * @param userId The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder userId(String userId) {
            return userId(Output.of(userId));
        }

        public SubscriptionArgs build() {
            if ($.apiManagementName == null) {
                throw new MissingRequiredPropertyException("SubscriptionArgs", "apiManagementName");
            }
            if ($.displayName == null) {
                throw new MissingRequiredPropertyException("SubscriptionArgs", "displayName");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("SubscriptionArgs", "resourceGroupName");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy