"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.RestApi = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The ``AWS::ApiGateway::RestApi`` resource creates a REST API. For more information, see [restapi:create](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateRestApi.html) in the *Amazon API Gateway REST API Reference*.
 *   On January 1, 2016, the Swagger Specification was donated to the [OpenAPI initiative](https://docs.aws.amazon.com/https://www.openapis.org/), becoming the foundation of the OpenAPI Specification.
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const description = config.require("description");
 * const version = config.require("version");
 * const type = config.require("type");
 * const property = config.require("property");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const documentationPart = new aws_native.apigateway.DocumentationPart("documentationPart", {
 *     location: {
 *         type: aws_native.apigateway.DocumentationPartLocationType[type],
 *     },
 *     restApiId: restApi.id,
 *     properties: property,
 * });
 * const documentationVersion = new aws_native.apigateway.DocumentationVersion("documentationVersion", {
 *     description: description,
 *     documentationVersion: version,
 *     restApiId: restApi.id,
 * }, {
 *     dependsOn: [documentationPart],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const description = config.require("description");
 * const version = config.require("version");
 * const type = config.require("type");
 * const property = config.require("property");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const documentationPart = new aws_native.apigateway.DocumentationPart("documentationPart", {
 *     location: {
 *         type: aws_native.apigateway.DocumentationPartLocationType[type],
 *     },
 *     restApiId: restApi.id,
 *     properties: property,
 * });
 * const documentationVersion = new aws_native.apigateway.DocumentationVersion("documentationVersion", {
 *     description: description,
 *     documentationVersion: version,
 *     restApiId: restApi.id,
 * }, {
 *     dependsOn: [documentationPart],
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: "myRestApi"});
 * const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
 *     responseParameters: {
 *         "gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
 *         "gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
 *     },
 *     responseType: "MISSING_AUTHENTICATION_TOKEN",
 *     restApiId: restApi.id,
 *     statusCode: "404",
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: "myRestApi"});
 * const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
 *     responseParameters: {
 *         "gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
 *         "gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
 *     },
 *     responseType: "MISSING_AUTHENTICATION_TOKEN",
 *     restApiId: restApi.id,
 *     statusCode: "404",
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const responseParameter1 = config.require("responseParameter1");
 * const responseParameter2 = config.require("responseParameter2");
 * const responseType = config.require("responseType");
 * const statusCode = config.require("statusCode");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
 *     responseParameters: {
 *         "gatewayresponse.header.k1": responseParameter1,
 *         "gatewayresponse.header.k2": responseParameter2,
 *     },
 *     responseType: responseType,
 *     restApiId: restApi.id,
 *     statusCode: statusCode,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const responseParameter1 = config.require("responseParameter1");
 * const responseParameter2 = config.require("responseParameter2");
 * const responseType = config.require("responseType");
 * const statusCode = config.require("statusCode");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const gatewayResponse = new aws_native.apigateway.GatewayResponse("gatewayResponse", {
 *     responseParameters: {
 *         "gatewayresponse.header.k1": responseParameter1,
 *         "gatewayresponse.header.k2": responseParameter2,
 *     },
 *     responseType: responseType,
 *     restApiId: restApi.id,
 *     statusCode: statusCode,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const contentHandling = config.require("contentHandling");
 * const operationName = config.get("operationName") || "testoperationName";
 * const restApiName = config.get("restApiName") || "testrestApiName";
 * const validatorName = config.get("validatorName") || "testvalidatorName";
 * const validateRequestBody = config.get("validateRequestBody") || "testvalidateRequestBody";
 * const validateRequestParameters = config.get("validateRequestParameters") || true;
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: restApiName});
 * const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
 *     name: validatorName,
 *     restApiId: restApi.id,
 *     validateRequestBody: validateRequestBody,
 *     validateRequestParameters: validateRequestParameters,
 * });
 * const method = new aws_native.apigateway.Method("method", {
 *     httpMethod: "POST",
 *     resourceId: restApi.rootResourceId,
 *     restApiId: restApi.id,
 *     authorizationType: "NONE",
 *     integration: {
 *         type: aws_native.apigateway.MethodIntegrationType.Mock,
 *         contentHandling: aws_native.apigateway.MethodIntegrationContentHandling[contentHandling],
 *         integrationResponses: [{
 *             contentHandling: aws_native.apigateway.MethodIntegrationResponseContentHandling[contentHandling],
 *             statusCode: "400",
 *         }],
 *     },
 *     requestValidatorId: requestValidator.id,
 *     operationName: operationName,
 * });
 * export const rootResourceId = restApi.rootResourceId;
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const contentHandling = config.require("contentHandling");
 * const operationName = config.get("operationName") || "testoperationName";
 * const restApiName = config.get("restApiName") || "testrestApiName";
 * const validatorName = config.get("validatorName") || "testvalidatorName";
 * const validateRequestBody = config.get("validateRequestBody") || "testvalidateRequestBody";
 * const validateRequestParameters = config.get("validateRequestParameters") || true;
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: restApiName});
 * const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
 *     name: validatorName,
 *     restApiId: restApi.id,
 *     validateRequestBody: validateRequestBody,
 *     validateRequestParameters: validateRequestParameters,
 * });
 * const method = new aws_native.apigateway.Method("method", {
 *     httpMethod: "POST",
 *     resourceId: restApi.rootResourceId,
 *     restApiId: restApi.id,
 *     authorizationType: "NONE",
 *     integration: {
 *         type: aws_native.apigateway.MethodIntegrationType.Mock,
 *         contentHandling: aws_native.apigateway.MethodIntegrationContentHandling[contentHandling],
 *         integrationResponses: [{
 *             contentHandling: aws_native.apigateway.MethodIntegrationResponseContentHandling[contentHandling],
 *             statusCode: "400",
 *         }],
 *     },
 *     requestValidatorId: requestValidator.id,
 *     operationName: operationName,
 * });
 * export const rootResourceId = restApi.rootResourceId;
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const validatorName = config.require("validatorName");
 * const validateRequestBody = config.require("validateRequestBody");
 * const validateRequestParameters = config.require("validateRequestParameters");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
 *     name: validatorName,
 *     restApiId: restApi.id,
 *     validateRequestBody: validateRequestBody,
 *     validateRequestParameters: validateRequestParameters,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const validatorName = config.require("validatorName");
 * const validateRequestBody = config.require("validateRequestBody");
 * const validateRequestParameters = config.require("validateRequestParameters");
 * const restApi = new aws_native.apigateway.RestApi("restApi", {name: apiName});
 * const requestValidator = new aws_native.apigateway.RequestValidator("requestValidator", {
 *     name: validatorName,
 *     restApiId: restApi.id,
 *     validateRequestBody: validateRequestBody,
 *     validateRequestParameters: validateRequestParameters,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const type = config.require("type");
 * const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
 *     endpointConfiguration: {
 *         types: [type],
 *     },
 *     name: apiName,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiName = config.require("apiName");
 * const type = config.require("type");
 * const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
 *     endpointConfiguration: {
 *         types: [type],
 *     },
 *     name: apiName,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const restApi = new aws_native.apigateway.RestApi("restApi", {
 *     body: {
 *         swagger: 2,
 *         info: {
 *             version: "0.0.1",
 *             title: "test",
 *         },
 *         basePath: "/pete",
 *         schemes: ["https"],
 *         definitions: {
 *             empty: {
 *                 type: "object",
 *             },
 *         },
 *     },
 *     name: "myApi",
 *     parameters: {
 *         endpointConfigurationTypes: "REGIONAL",
 *     },
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const restApi = new aws_native.apigateway.RestApi("restApi", {
 *     body: {
 *         swagger: 2,
 *         info: {
 *             version: "0.0.1",
 *             title: "test",
 *         },
 *         basePath: "/pete",
 *         schemes: ["https"],
 *         definitions: {
 *             empty: {
 *                 type: "object",
 *             },
 *         },
 *     },
 *     name: "myApi",
 *     parameters: {
 *         endpointConfigurationTypes: "REGIONAL",
 *     },
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiKeySourceType = config.require("apiKeySourceType");
 * const apiName = config.require("apiName");
 * const binaryMediaType1 = config.require("binaryMediaType1");
 * const binaryMediaType2 = config.require("binaryMediaType2");
 * const minimumCompressionSize = config.require("minimumCompressionSize");
 * const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
 *     apiKeySourceType: apiKeySourceType,
 *     binaryMediaTypes: [
 *         binaryMediaType1,
 *         binaryMediaType2,
 *     ],
 *     minimumCompressionSize: minimumCompressionSize,
 *     name: apiName,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const config = new pulumi.Config();
 * const apiKeySourceType = config.require("apiKeySourceType");
 * const apiName = config.require("apiName");
 * const binaryMediaType1 = config.require("binaryMediaType1");
 * const binaryMediaType2 = config.require("binaryMediaType2");
 * const minimumCompressionSize = config.require("minimumCompressionSize");
 * const myRestApi = new aws_native.apigateway.RestApi("myRestApi", {
 *     apiKeySourceType: apiKeySourceType,
 *     binaryMediaTypes: [
 *         binaryMediaType1,
 *         binaryMediaType2,
 *     ],
 *     minimumCompressionSize: minimumCompressionSize,
 *     name: apiName,
 * });
 *
 * ```
 */
class RestApi extends pulumi.CustomResource {
    /**
     * Get an existing RestApi 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new RestApi(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of RestApi.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === RestApi.__pulumiType;
    }
    /**
     * Create a RestApi resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            resourceInputs["apiKeySourceType"] = args ? args.apiKeySourceType : undefined;
            resourceInputs["binaryMediaTypes"] = args ? args.binaryMediaTypes : undefined;
            resourceInputs["body"] = args ? args.body : undefined;
            resourceInputs["bodyS3Location"] = args ? args.bodyS3Location : undefined;
            resourceInputs["cloneFrom"] = args ? args.cloneFrom : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["disableExecuteApiEndpoint"] = args ? args.disableExecuteApiEndpoint : undefined;
            resourceInputs["endpointConfiguration"] = args ? args.endpointConfiguration : undefined;
            resourceInputs["failOnWarnings"] = args ? args.failOnWarnings : undefined;
            resourceInputs["minimumCompressionSize"] = args ? args.minimumCompressionSize : undefined;
            resourceInputs["mode"] = args ? args.mode : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
            resourceInputs["parameters"] = args ? args.parameters : undefined;
            resourceInputs["policy"] = args ? args.policy : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["restApiId"] = undefined /*out*/;
            resourceInputs["rootResourceId"] = undefined /*out*/;
        }
        else {
            resourceInputs["apiKeySourceType"] = undefined /*out*/;
            resourceInputs["binaryMediaTypes"] = undefined /*out*/;
            resourceInputs["body"] = undefined /*out*/;
            resourceInputs["bodyS3Location"] = undefined /*out*/;
            resourceInputs["cloneFrom"] = undefined /*out*/;
            resourceInputs["description"] = undefined /*out*/;
            resourceInputs["disableExecuteApiEndpoint"] = undefined /*out*/;
            resourceInputs["endpointConfiguration"] = undefined /*out*/;
            resourceInputs["failOnWarnings"] = undefined /*out*/;
            resourceInputs["minimumCompressionSize"] = undefined /*out*/;
            resourceInputs["mode"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["parameters"] = undefined /*out*/;
            resourceInputs["policy"] = undefined /*out*/;
            resourceInputs["restApiId"] = undefined /*out*/;
            resourceInputs["rootResourceId"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RestApi.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RestApi = RestApi;
/** @internal */
RestApi.__pulumiType = 'aws-native:apigateway:RestApi';
//# sourceMappingURL=restApi.js.map