// *** 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.azure.Utilities;
import com.pulumi.azure.apimanagement.GatewayApiArgs;
import com.pulumi.azure.apimanagement.inputs.GatewayApiState;
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 javax.annotation.Nullable;

/**
 * Manages a API Management Gateway API.
 * 
 * ## Example Usage
 * ```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.GetServiceArgs;
 * import com.pulumi.azure.apimanagement.inputs.GetApiArgs;
 * import com.pulumi.azure.apimanagement.inputs.GetGatewayArgs;
 * import com.pulumi.azure.apimanagement.GatewayApi;
 * import com.pulumi.azure.apimanagement.GatewayApiArgs;
 * 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 exampleService = ApimanagementFunctions.getService(GetServiceArgs.builder()
 *             .name(&#34;example-api&#34;)
 *             .resourceGroupName(&#34;example-resources&#34;)
 *             .build());
 * 
 *         final var exampleApi = ApimanagementFunctions.getApi(GetApiArgs.builder()
 *             .name(&#34;search-api&#34;)
 *             .apiManagementName(exampleService.applyValue(getServiceResult -&gt; getServiceResult.name()))
 *             .resourceGroupName(exampleService.applyValue(getServiceResult -&gt; getServiceResult.resourceGroupName()))
 *             .revision(&#34;2&#34;)
 *             .build());
 * 
 *         final var exampleGateway = ApimanagementFunctions.getGateway(GetGatewayArgs.builder()
 *             .name(&#34;example-gateway&#34;)
 *             .apiManagementId(exampleService.applyValue(getServiceResult -&gt; getServiceResult.id()))
 *             .build());
 * 
 *         var exampleGatewayApi = new GatewayApi(&#34;exampleGatewayApi&#34;, GatewayApiArgs.builder()        
 *             .gatewayId(exampleGateway.applyValue(getGatewayResult -&gt; getGatewayResult.id()))
 *             .apiId(exampleApi.applyValue(getApiResult -&gt; getApiResult.id()))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * API Management Gateway APIs can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:apimanagement/gatewayApi:GatewayApi example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1/apis/api1
 * ```
 * 
 */
@ResourceType(type="azure:apimanagement/gatewayApi:GatewayApi")
public class GatewayApi extends com.pulumi.resources.CustomResource {
    /**
     * The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
     * 
     */
    @Export(name="apiId", refs={String.class}, tree="[0]")
    private Output<String> apiId;

    /**
     * @return The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
     * 
     */
    public Output<String> apiId() {
        return this.apiId;
    }
    /**
     * The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
     * 
     */
    @Export(name="gatewayId", refs={String.class}, tree="[0]")
    private Output<String> gatewayId;

    /**
     * @return The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
     * 
     */
    public Output<String> gatewayId() {
        return this.gatewayId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public GatewayApi(String name) {
        this(name, GatewayApiArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public GatewayApi(String name, GatewayApiArgs 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 GatewayApi(String name, GatewayApiArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:apimanagement/gatewayApi:GatewayApi", name, args == null ? GatewayApiArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private GatewayApi(String name, Output<String> id, @Nullable GatewayApiState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:apimanagement/gatewayApi:GatewayApi", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 GatewayApi get(String name, Output<String> id, @Nullable GatewayApiState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new GatewayApi(name, id, state, options);
    }
}
