"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionConnection = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * A connection that can be used in Actions, including in the Workflow Automation and App Builder products. This resource requires a registered application key.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const awsConnection = new datadog.ActionConnection("aws_connection", {
 *     name: "My AWS Connection",
 *     aws: [{
 *         assumeRole: [{
 *             accountId: "123456789012",
 *             role: "role2",
 *         }],
 *     }],
 * });
 * const config = new pulumi.Config();
 * const token1 = config.require("token1");
 * const token2 = config.require("token2");
 * const httpConnection = new datadog.ActionConnection("http_connection", {
 *     name: "My HTTP connection with token auth",
 *     http: [{
 *         baseUrl: "https://catfact.ninja",
 *         tokenAuth: [{
 *             tokens: [
 *                 {
 *                     type: "SECRET",
 *                     name: "token1",
 *                     value: token1,
 *                 },
 *                 {
 *                     type: "SECRET",
 *                     name: "token2",
 *                     value: token2,
 *                 },
 *             ],
 *             headers: [
 *                 {
 *                     name: "header-one",
 *                     value: "headerval",
 *                 },
 *                 {
 *                     name: "h2",
 *                     value: "{{ token1 }} test",
 *                 },
 *             ],
 *             urlParameters: [
 *                 {
 *                     name: "param1",
 *                     value: "{{ token1 }}",
 *                 },
 *                 {
 *                     name: "param2",
 *                     value: "paramVal2",
 *                 },
 *             ],
 *             body: [{
 *                 contentType: "application/json",
 *                 content: JSON.stringify({
 *                     key: "mykey",
 *                     value: "maybe with a secret: {{ token2 }}",
 *                 }),
 *             }],
 *         }],
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/actionConnection:ActionConnection my_connection 11111111-2222-3333-4444-555555555555
 * ```
 */
class ActionConnection extends pulumi.CustomResource {
    /**
     * Get an existing ActionConnection 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ActionConnection(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/actionConnection:ActionConnection';
    /**
     * Returns true if the given object is an instance of ActionConnection.  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'] === ActionConnection.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["aws"] = state?.aws;
            resourceInputs["http"] = state?.http;
            resourceInputs["name"] = state?.name;
        }
        else {
            const args = argsOrState;
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            resourceInputs["aws"] = args?.aws;
            resourceInputs["http"] = args?.http;
            resourceInputs["name"] = args?.name;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ActionConnection.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ActionConnection = ActionConnection;
//# sourceMappingURL=actionConnection.js.map