"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.Agent = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Description
 *
 * ## Example Usage
 *
 * ### Ces Agent Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForAgent = new gcp.ces.App("ces_app_for_agent", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Agent example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolForAgent = new gcp.ces.Tool("ces_tool_for_agent", {
 *     location: "us",
 *     app: cesAppForAgent.appId,
 *     toolId: "tool-1",
 *     executionType: "SYNCHRONOUS",
 *     pythonFunction: {
 *         name: "example_function",
 *         pythonCode: "def example_function() -> int: return 0",
 *     },
 * });
 * const cesToolsetForAgent = new gcp.ces.Toolset("ces_toolset_for_agent", {
 *     toolsetId: "toolset-id",
 *     location: "us",
 *     app: cesAppForAgent.appId,
 *     displayName: "Basic toolset display name",
 *     openApiToolset: {
 *         openApiSchema: `openapi: 3.0.0
 * info:
 *   title: My Sample API
 *   version: 1.0.0
 *   description: A simple API example
 * servers:
 *   - url: https://api.example.com/v1
 * paths: {}
 * `,
 *         ignoreUnknownFields: false,
 *         tlsConfig: {
 *             caCerts: [{
 *                 displayName: "example",
 *                 cert: "ZXhhbXBsZQ==",
 *             }],
 *         },
 *         serviceDirectoryConfig: {
 *             service: "projects/example/locations/us/namespaces/namespace/services/service",
 *         },
 *         apiAuthentication: {
 *             serviceAgentIdTokenAuthConfig: {},
 *         },
 *     },
 * });
 * const cesChildAgent = new gcp.ces.Agent("ces_child_agent", {
 *     agentId: "child-agent-id",
 *     location: "us",
 *     app: cesAppForAgent.appId,
 *     displayName: "child agent",
 *     instruction: "You are a helpful assistant for this example.",
 *     modelSettings: {
 *         model: "gemini-1.5-flash",
 *         temperature: 0.5,
 *     },
 *     llmAgent: {},
 * });
 * const cesGuardrailForAgent = new gcp.ces.Guardrail("ces_guardrail_for_agent", {
 *     guardrailId: "guardrail-id",
 *     location: cesAppForAgent.location,
 *     app: cesAppForAgent.appId,
 *     displayName: "Example guardrail",
 *     description: "Guardrail description",
 *     action: {
 *         respondImmediately: {
 *             responses: [{
 *                 text: "Text",
 *                 disabled: false,
 *             }],
 *         },
 *     },
 *     enabled: true,
 *     modelSafety: {
 *         safetySettings: [{
 *             category: "HARM_CATEGORY_HATE_SPEECH",
 *             threshold: "BLOCK_NONE",
 *         }],
 *     },
 * });
 * const cesAgentBasic = new gcp.ces.Agent("ces_agent_basic", {
 *     agentId: "agent-id",
 *     location: "us",
 *     app: cesAppForAgent.appId,
 *     displayName: "my-agent",
 *     description: "test agent",
 *     instruction: "You are a helpful assistant for this example.",
 *     modelSettings: {
 *         model: "gemini-1.5-flash",
 *         temperature: 0.5,
 *     },
 *     afterAgentCallbacks: [{
 *         description: "Example callback",
 *         disabled: true,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     beforeAgentCallbacks: [{
 *         description: "Example callback",
 *         disabled: false,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     afterModelCallbacks: [{
 *         description: "Example callback",
 *         disabled: true,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     beforeModelCallbacks: [{
 *         description: "Example callback",
 *         disabled: true,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     afterToolCallbacks: [{
 *         description: "Example callback",
 *         disabled: true,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     beforeToolCallbacks: [{
 *         description: "Example callback",
 *         disabled: true,
 *         pythonCode: `def callback(context):
 *     return {'override': False}`,
 *     }],
 *     tools: [cesToolForAgent.id],
 *     guardrails: [cesGuardrailForAgent.id],
 *     toolsets: [{
 *         toolset: cesToolsetForAgent.id,
 *         toolIds: ["testtoolid"],
 *     }],
 *     childAgents: [pulumi.all([cesAppForAgent.project, cesAppForAgent.appId, cesChildAgent.agentId]).apply(([project, appId, agentId]) => `projects/${project}/locations/us/apps/${appId}/agents/${agentId}`)],
 *     llmAgent: {},
 * });
 * ```
 * ### Ces Agent Remote Dialogflow Agent
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForAgent = new gcp.ces.App("ces_app_for_agent", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Agent example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesAgentRemoteDialogflowAgent = new gcp.ces.Agent("ces_agent_remote_dialogflow_agent", {
 *     agentId: "agent-id",
 *     location: "us",
 *     app: cesAppForAgent.appId,
 *     displayName: "my-agent",
 *     modelSettings: {
 *         model: "gemini-1.5-flash",
 *         temperature: 0.5,
 *     },
 *     remoteDialogflowAgent: {
 *         agent: "projects/example/locations/us/agents/fake-agent",
 *         flowId: "fake-flow",
 *         environmentId: "fake-env",
 *         inputVariableMapping: {
 *             example: "1",
 *         },
 *         outputVariableMapping: {
 *             example: "1",
 *         },
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Agent can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/apps/{{app}}/agents/{{name}}`
 *
 * * `{{project}}/{{location}}/{{app}}/{{name}}`
 *
 * * `{{location}}/{{app}}/{{name}}`
 *
 * When using the `pulumi import` command, Agent can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:ces/agent:Agent default projects/{{project}}/locations/{{location}}/apps/{{app}}/agents/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/agent:Agent default {{project}}/{{location}}/{{app}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/agent:Agent default {{location}}/{{app}}/{{name}}
 * ```
 */
class Agent extends pulumi.CustomResource {
    /**
     * Get an existing Agent 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 Agent(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Agent.  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'] === Agent.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["afterAgentCallbacks"] = state?.afterAgentCallbacks;
            resourceInputs["afterModelCallbacks"] = state?.afterModelCallbacks;
            resourceInputs["afterToolCallbacks"] = state?.afterToolCallbacks;
            resourceInputs["agentId"] = state?.agentId;
            resourceInputs["app"] = state?.app;
            resourceInputs["beforeAgentCallbacks"] = state?.beforeAgentCallbacks;
            resourceInputs["beforeModelCallbacks"] = state?.beforeModelCallbacks;
            resourceInputs["beforeToolCallbacks"] = state?.beforeToolCallbacks;
            resourceInputs["childAgents"] = state?.childAgents;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["generatedSummary"] = state?.generatedSummary;
            resourceInputs["guardrails"] = state?.guardrails;
            resourceInputs["instruction"] = state?.instruction;
            resourceInputs["llmAgent"] = state?.llmAgent;
            resourceInputs["location"] = state?.location;
            resourceInputs["modelSettings"] = state?.modelSettings;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["remoteDialogflowAgent"] = state?.remoteDialogflowAgent;
            resourceInputs["tools"] = state?.tools;
            resourceInputs["toolsets"] = state?.toolsets;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.app === undefined && !opts.urn) {
                throw new Error("Missing required property 'app'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["afterAgentCallbacks"] = args?.afterAgentCallbacks;
            resourceInputs["afterModelCallbacks"] = args?.afterModelCallbacks;
            resourceInputs["afterToolCallbacks"] = args?.afterToolCallbacks;
            resourceInputs["agentId"] = args?.agentId;
            resourceInputs["app"] = args?.app;
            resourceInputs["beforeAgentCallbacks"] = args?.beforeAgentCallbacks;
            resourceInputs["beforeModelCallbacks"] = args?.beforeModelCallbacks;
            resourceInputs["beforeToolCallbacks"] = args?.beforeToolCallbacks;
            resourceInputs["childAgents"] = args?.childAgents;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["guardrails"] = args?.guardrails;
            resourceInputs["instruction"] = args?.instruction;
            resourceInputs["llmAgent"] = args?.llmAgent;
            resourceInputs["location"] = args?.location;
            resourceInputs["modelSettings"] = args?.modelSettings;
            resourceInputs["project"] = args?.project;
            resourceInputs["remoteDialogflowAgent"] = args?.remoteDialogflowAgent;
            resourceInputs["tools"] = args?.tools;
            resourceInputs["toolsets"] = args?.toolsets;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["generatedSummary"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Agent.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Agent = Agent;
/** @internal */
Agent.__pulumiType = 'gcp:ces/agent:Agent';
//# sourceMappingURL=agent.js.map