"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.Example = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An example represents a sample conversation between the user and the agent(s).
 *
 * ## Example Usage
 *
 * ### Ces Example Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const my_app = new gcp.ces.App("my-app", {
 *     location: "us",
 *     displayName: "my-app",
 *     appId: "app-id",
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesTool = new gcp.ces.Tool("ces_tool", {
 *     location: "us",
 *     app: my_app.appId,
 *     toolId: "tool-1",
 *     executionType: "SYNCHRONOUS",
 *     pythonFunction: {
 *         name: "example_function",
 *         pythonCode: "def example_function() -> int: return 0",
 *     },
 * });
 * const cesToolset = new gcp.ces.Toolset("ces_toolset", {
 *     toolsetId: "toolset-id",
 *     location: "us",
 *     app: my_app.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 cesBaseAgent = new gcp.ces.Agent("ces_base_agent", {
 *     agentId: "base-agent-id",
 *     location: "us",
 *     app: my_app.appId,
 *     displayName: "base agent",
 *     instruction: "You are a helpful assistant for this example.",
 *     modelSettings: {
 *         model: "gemini-2.5-flash",
 *         temperature: 0.5,
 *     },
 *     llmAgent: {},
 * });
 * const cesChildAgent = new gcp.ces.Agent("ces_child_agent", {
 *     agentId: "child-agent-id",
 *     location: "us",
 *     app: my_app.appId,
 *     displayName: "child agent",
 *     instruction: "You are a helpful assistant for this example.",
 *     modelSettings: {
 *         model: "gemini-2.5-flash",
 *         temperature: 0.5,
 *     },
 *     llmAgent: {},
 * });
 * const my_example = new gcp.ces.Example("my-example", {
 *     location: "us",
 *     displayName: "my-example",
 *     app: my_app.name,
 *     exampleId: "example-id",
 *     description: "example description",
 *     entryAgent: pulumi.all([my_app.project, my_app.appId, cesBaseAgent.agentId]).apply(([project, appId, agentId]) => `projects/${project}/locations/us/apps/${appId}/agents/${agentId}`),
 *     messages: [{
 *         chunks: [
 *             {
 *                 agentTransfer: {
 *                     targetAgent: pulumi.all([my_app.project, my_app.appId, cesChildAgent.agentId]).apply(([project, appId, agentId]) => `projects/${project}/locations/us/apps/${appId}/agents/${agentId}`),
 *                 },
 *             },
 *             {
 *                 image: {
 *                     mimeType: "image/png",
 *                     data: std.base64encode({
 *                         input: "This is some fake image binary data.",
 *                     }).then(invoke => invoke.result),
 *                 },
 *             },
 *             {
 *                 text: "text_data",
 *             },
 *             {
 *                 toolCall: {
 *                     args: JSON.stringify({
 *                         arg1: "val1",
 *                         arg2: "val2",
 *                     }),
 *                     id: "tool_call_id",
 *                     tool: pulumi.interpolate`projects/${my_app.project}/locations/us/apps/${my_app.appId}/tools/${cesTool.toolId}`,
 *                 },
 *             },
 *             {
 *                 toolCall: {
 *                     args: JSON.stringify({
 *                         arg1: "val1",
 *                         arg2: "val2",
 *                     }),
 *                     id: "tool_call_id2",
 *                     toolsetTool: {
 *                         toolset: pulumi.interpolate`projects/${my_app.project}/locations/us/apps/${my_app.appId}/toolsets/${cesToolset.toolsetId}`,
 *                         toolId: "example-id",
 *                     },
 *                 },
 *             },
 *             {
 *                 toolResponse: {
 *                     id: "tool_call_id",
 *                     response: JSON.stringify({
 *                         output: "example-output",
 *                     }),
 *                     tool: pulumi.interpolate`projects/${my_app.project}/locations/us/apps/${my_app.appId}/tools/${cesTool.toolId}`,
 *                 },
 *             },
 *             {
 *                 toolResponse: {
 *                     id: "tool_call_id2",
 *                     response: JSON.stringify({
 *                         output: "example-output",
 *                     }),
 *                     toolsetTool: {
 *                         toolset: pulumi.interpolate`projects/${my_app.project}/locations/us/apps/${my_app.appId}/toolsets/${cesToolset.toolsetId}`,
 *                         toolId: "example-id",
 *                     },
 *                 },
 *             },
 *             {
 *                 updatedVariables: JSON.stringify({
 *                     var1: "val1",
 *                     var2: "val2",
 *                 }),
 *             },
 *         ],
 *         role: "agent",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * Example can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/apps/{{app}}/examples/{{name}}`
 *
 * * `{{project}}/{{location}}/{{app}}/{{name}}`
 *
 * * `{{location}}/{{app}}/{{name}}`
 *
 * When using the `pulumi import` command, Example can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:ces/example:Example default projects/{{project}}/locations/{{location}}/apps/{{app}}/examples/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/example:Example default {{project}}/{{location}}/{{app}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/example:Example default {{location}}/{{app}}/{{name}}
 * ```
 */
class Example extends pulumi.CustomResource {
    /**
     * Get an existing Example 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 Example(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Example.  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'] === Example.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["app"] = state?.app;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["entryAgent"] = state?.entryAgent;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["exampleId"] = state?.exampleId;
            resourceInputs["invalid"] = state?.invalid;
            resourceInputs["location"] = state?.location;
            resourceInputs["messages"] = state?.messages;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            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?.exampleId === undefined && !opts.urn) {
                throw new Error("Missing required property 'exampleId'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["app"] = args?.app;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["entryAgent"] = args?.entryAgent;
            resourceInputs["exampleId"] = args?.exampleId;
            resourceInputs["location"] = args?.location;
            resourceInputs["messages"] = args?.messages;
            resourceInputs["project"] = args?.project;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["invalid"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Example.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Example = Example;
/** @internal */
Example.__pulumiType = 'gcp:ces/example:Example';
//# sourceMappingURL=example.js.map