// *** 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.gcp.cloudrun;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.cloudrun.DomainMappingArgs;
import com.pulumi.gcp.cloudrun.inputs.DomainMappingState;
import com.pulumi.gcp.cloudrun.outputs.DomainMappingMetadata;
import com.pulumi.gcp.cloudrun.outputs.DomainMappingSpec;
import com.pulumi.gcp.cloudrun.outputs.DomainMappingStatus;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;

/**
 * Resource to hold the state and status of a user&#39;s domain mapping.
 * 
 * To get more information about DomainMapping, see:
 * 
 * * [API documentation](https://cloud.google.com/run/docs/reference/rest/v1/projects.locations.domainmappings)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/run/docs/mapping-custom-domains)
 * 
 * ## Example Usage
 * ### Cloud Run Domain Mapping Basic
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.cloudrun.Service;
 * import com.pulumi.gcp.cloudrun.ServiceArgs;
 * import com.pulumi.gcp.cloudrun.inputs.ServiceMetadataArgs;
 * import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateArgs;
 * import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs;
 * import com.pulumi.gcp.cloudrun.DomainMapping;
 * import com.pulumi.gcp.cloudrun.DomainMappingArgs;
 * import com.pulumi.gcp.cloudrun.inputs.DomainMappingMetadataArgs;
 * import com.pulumi.gcp.cloudrun.inputs.DomainMappingSpecArgs;
 * 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) {
 *         var defaultService = new Service(&#34;defaultService&#34;, ServiceArgs.builder()        
 *             .location(&#34;us-central1&#34;)
 *             .metadata(ServiceMetadataArgs.builder()
 *                 .namespace(&#34;my-project-name&#34;)
 *                 .build())
 *             .template(ServiceTemplateArgs.builder()
 *                 .spec(ServiceTemplateSpecArgs.builder()
 *                     .containers(ServiceTemplateSpecContainerArgs.builder()
 *                         .image(&#34;us-docker.pkg.dev/cloudrun/container/hello&#34;)
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 * 
 *         var defaultDomainMapping = new DomainMapping(&#34;defaultDomainMapping&#34;, DomainMappingArgs.builder()        
 *             .location(&#34;us-central1&#34;)
 *             .metadata(DomainMappingMetadataArgs.builder()
 *                 .namespace(&#34;my-project-name&#34;)
 *                 .build())
 *             .spec(DomainMappingSpecArgs.builder()
 *                 .routeName(defaultService.name())
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * DomainMapping can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:cloudrun/domainMapping:DomainMapping default locations/{{location}}/namespaces/{{project}}/domainmappings/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:cloudrun/domainMapping:DomainMapping default {{location}}/{{project}}/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:cloudrun/domainMapping:DomainMapping default {{location}}/{{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:cloudrun/domainMapping:DomainMapping")
public class DomainMapping extends com.pulumi.resources.CustomResource {
    /**
     * The location of the cloud run instance. eg us-central1
     * 
     */
    @Export(name="location", type=String.class, parameters={})
    private Output<String> location;

    /**
     * @return The location of the cloud run instance. eg us-central1
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Metadata associated with this DomainMapping.
     * Structure is documented below.
     * 
     */
    @Export(name="metadata", type=DomainMappingMetadata.class, parameters={})
    private Output<DomainMappingMetadata> metadata;

    /**
     * @return Metadata associated with this DomainMapping.
     * Structure is documented below.
     * 
     */
    public Output<DomainMappingMetadata> metadata() {
        return this.metadata;
    }
    /**
     * Name should be a [verified](https://support.google.com/webmasters/answer/9008080) domain
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return Name should be a [verified](https://support.google.com/webmasters/answer/9008080) domain
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Export(name="project", type=String.class, parameters={})
    private Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Output<String> project() {
        return this.project;
    }
    /**
     * The spec for this DomainMapping.
     * Structure is documented below.
     * 
     */
    @Export(name="spec", type=DomainMappingSpec.class, parameters={})
    private Output<DomainMappingSpec> spec;

    /**
     * @return The spec for this DomainMapping.
     * Structure is documented below.
     * 
     */
    public Output<DomainMappingSpec> spec() {
        return this.spec;
    }
    /**
     * (Output)
     * Status of the condition, one of True, False, Unknown.
     * 
     */
    @Export(name="statuses", type=List.class, parameters={DomainMappingStatus.class})
    private Output<List<DomainMappingStatus>> statuses;

    /**
     * @return (Output)
     * Status of the condition, one of True, False, Unknown.
     * 
     */
    public Output<List<DomainMappingStatus>> statuses() {
        return this.statuses;
    }

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

    private DomainMapping(String name, Output<String> id, @Nullable DomainMappingState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:cloudrun/domainMapping:DomainMapping", 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 DomainMapping get(String name, Output<String> id, @Nullable DomainMappingState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new DomainMapping(name, id, state, options);
    }
}
