"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.Connector = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Service Connector resource in Oracle Cloud Infrastructure Service Connector Hub service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/serviceconnectors/latest/ServiceConnector
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/service_connector_hub
 *
 * Creates a new connector in the specified compartment.
 * A connector is a logically defined flow for moving data from
 * a source service to a destination service in Oracle Cloud Infrastructure.
 * For more information, see
 * [Creating a Connector](https://docs.cloud.oracle.com/iaas/Content/connector-hub/create-service-connector.htm).
 * For general information about connectors, see
 * [Overview of Connector Hub](https://docs.cloud.oracle.com/iaas/Content/connector-hub/overview.htm).
 *
 * For purposes of access control, you must provide the
 * [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where
 * you want the connector to reside. Notice that the connector
 * doesn't have to be in the same compartment as the source or target services.
 * For information about access control and compartments, see
 * [Overview of the IAM Service](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm).
 *
 * After you send your request, the new connector's state is temporarily
 * CREATING. When the state changes to ACTIVE, data begins transferring from the
 * source service to the target service. For instructions on deactivating and
 * activating connectors, see
 * [Activating a Connector](https://docs.cloud.oracle.com/iaas/Content/connector-hub/activate-service-connector.htm).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testServiceConnector = new oci.sch.Connector("test_service_connector", {
 *     compartmentId: compartmentId,
 *     displayName: serviceConnectorDisplayName,
 *     source: {
 *         kind: serviceConnectorSourceKind,
 *         configMap: serviceConnectorSourceConfigMap,
 *         cursor: {
 *             kind: serviceConnectorSourceCursorKind,
 *         },
 *         logSources: [{
 *             compartmentId: compartmentId,
 *             logGroupId: testLogGroup.id,
 *             logId: testLog.id,
 *         }],
 *         monitoringSources: [{
 *             compartmentId: compartmentId,
 *             namespaceDetails: {
 *                 kind: serviceConnectorSourceMonitoringSourcesNamespaceDetailsKind,
 *                 namespaces: [{
 *                     metrics: {
 *                         kind: serviceConnectorSourceMonitoringSourcesNamespaceDetailsNamespacesMetricsKind,
 *                     },
 *                     namespace: serviceConnectorSourceMonitoringSourcesNamespaceDetailsNamespacesNamespace,
 *                 }],
 *             },
 *         }],
 *         pluginName: serviceConnectorSourcePluginName,
 *         streamId: testStream.id,
 *     },
 *     target: {
 *         kind: serviceConnectorTargetKind,
 *         batchRolloverSizeInMbs: Number(serviceConnectorTargetBatchRolloverSizeInMbs),
 *         batchRolloverTimeInMs: Number(serviceConnectorTargetBatchRolloverTimeInMs),
 *         batchSizeInKbs: Number(serviceConnectorTargetBatchSizeInKbs),
 *         batchSizeInNum: Number(serviceConnectorTargetBatchSizeInNum),
 *         batchTimeInSec: Number(serviceConnectorTargetBatchTimeInSec),
 *         bucket: serviceConnectorTargetBucket,
 *         compartmentId: compartmentId,
 *         dimensions: [{
 *             dimensionValue: {
 *                 kind: serviceConnectorTargetDimensionsDimensionValueKind,
 *                 path: serviceConnectorTargetDimensionsDimensionValuePath,
 *                 value: serviceConnectorTargetDimensionsDimensionValueValue,
 *             },
 *             name: serviceConnectorTargetDimensionsName,
 *         }],
 *         enableFormattedMessaging: serviceConnectorTargetEnableFormattedMessaging === "true",
 *         functionId: testFunction.id,
 *         logGroupId: testLogGroup.id,
 *         logSourceIdentifier: serviceConnectorTargetLogSourceIdentifier,
 *         metric: serviceConnectorTargetMetric,
 *         metricNamespace: serviceConnectorTargetMetricNamespace,
 *         namespace: serviceConnectorTargetNamespace,
 *         objectNamePrefix: serviceConnectorTargetObjectNamePrefix,
 *         streamId: testStream.id,
 *         topicId: testNotificationTopic.id,
 *     },
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     description: serviceConnectorDescription,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     tasks: [{
 *         kind: serviceConnectorTasksKind,
 *         batchSizeInKbs: Number(serviceConnectorTasksBatchSizeInKbs),
 *         batchTimeInSec: Number(serviceConnectorTasksBatchTimeInSec),
 *         condition: serviceConnectorTasksCondition,
 *         functionId: testFunction.id,
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * ServiceConnectors can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Sch/connector:Connector test_service_connector "id"
 * ```
 */
class Connector extends pulumi.CustomResource {
    /**
     * Get an existing Connector 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 Connector(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Sch/connector:Connector';
    /**
     * Returns true if the given object is an instance of Connector.  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'] === Connector.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["lifecyleDetails"] = state?.lifecyleDetails;
            resourceInputs["source"] = state?.source;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["target"] = state?.target;
            resourceInputs["tasks"] = state?.tasks;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.source === undefined && !opts.urn) {
                throw new Error("Missing required property 'source'");
            }
            if (args?.target === undefined && !opts.urn) {
                throw new Error("Missing required property 'target'");
            }
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["source"] = args?.source;
            resourceInputs["state"] = args?.state;
            resourceInputs["target"] = args?.target;
            resourceInputs["tasks"] = args?.tasks;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["lifecyleDetails"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Connector.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Connector = Connector;
//# sourceMappingURL=connector.js.map