"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.Toolset = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Description
 *
 * ## Example Usage
 *
 * ### Ces Toolset Openapi Service Account Auth Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForToolset = new gcp.ces.App("ces_app_for_toolset", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Toolset example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolsetOpenapiServiceAccountAuthConfig = new gcp.ces.Toolset("ces_toolset_openapi_service_account_auth_config", {
 *     toolsetId: "toolset1",
 *     location: "us",
 *     app: cesAppForToolset.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: {
 *             serviceAccountAuthConfig: {
 *                 serviceAccount: "testaccount@gmail.com",
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Ces Toolset Openapi Oauth Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForToolset = new gcp.ces.App("ces_app_for_toolset", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Toolset example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolsetOpenapiOauthConfig = new gcp.ces.Toolset("ces_toolset_openapi_oauth_config", {
 *     toolsetId: "toolset1",
 *     location: "us",
 *     app: cesAppForToolset.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: {
 *             oauthConfig: {
 *                 oauthGrantType: "CLIENT_CREDENTIAL",
 *                 clientId: "example_client_id",
 *                 clientSecretVersion: "projects/fake-project/secrets/fake-secret/versions/version1",
 *                 tokenEndpoint: "123",
 *                 scopes: ["scope1"],
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Ces Toolset Openapi Service Agent Id Token Auth Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForToolset = new gcp.ces.App("ces_app_for_toolset", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Toolset example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolsetOpenapiServiceAgentIdTokenAuthConfig = new gcp.ces.Toolset("ces_toolset_openapi_service_agent_id_token_auth_config", {
 *     toolsetId: "toolset1",
 *     location: "us",
 *     app: cesAppForToolset.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: {},
 *         },
 *     },
 * });
 * ```
 * ### Ces Toolset Openapi Api Key Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForToolset = new gcp.ces.App("ces_app_for_toolset", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Toolset example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolsetOpenapiApiKeyConfig = new gcp.ces.Toolset("ces_toolset_openapi_api_key_config", {
 *     toolsetId: "toolset1",
 *     location: "us",
 *     app: cesAppForToolset.appId,
 *     displayName: "Basic toolset display name",
 *     description: "Test description",
 *     executionType: "SYNCHRONOUS",
 *     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: {
 *             apiKeyConfig: {
 *                 keyName: "ExampleKey",
 *                 apiKeySecretVersion: "projects/fake-project/secrets/fake-secret/versions/version-1",
 *                 requestLocation: "HEADER",
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Ces Toolset Bearer Token Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cesAppForToolset = new gcp.ces.App("ces_app_for_toolset", {
 *     appId: "app-id",
 *     location: "us",
 *     description: "App used as parent for CES Toolset example",
 *     displayName: "my-app",
 *     languageSettings: {
 *         defaultLanguageCode: "en-US",
 *         supportedLanguageCodes: [
 *             "es-ES",
 *             "fr-FR",
 *         ],
 *         enableMultilingualSupport: true,
 *         fallbackAction: "escalate",
 *     },
 *     timeZoneSettings: {
 *         timeZone: "America/Los_Angeles",
 *     },
 * });
 * const cesToolsetBearerTokenConfig = new gcp.ces.Toolset("ces_toolset_bearer_token_config", {
 *     toolsetId: "toolset1",
 *     location: "us",
 *     app: cesAppForToolset.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: {
 *             bearerTokenConfig: {
 *                 token: "$context.variables.my_ces_toolset_auth_token",
 *             },
 *         },
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Toolset can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/apps/{{app}}/toolsets/{{toolset_id}}`
 *
 * * `{{project}}/{{location}}/{{app}}/{{toolset_id}}`
 *
 * * `{{location}}/{{app}}/{{toolset_id}}`
 *
 * When using the `pulumi import` command, Toolset can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:ces/toolset:Toolset default projects/{{project}}/locations/{{location}}/apps/{{app}}/toolsets/{{toolset_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/toolset:Toolset default {{project}}/{{location}}/{{app}}/{{toolset_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:ces/toolset:Toolset default {{location}}/{{app}}/{{toolset_id}}
 * ```
 */
class Toolset extends pulumi.CustomResource {
    /**
     * Get an existing Toolset 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 Toolset(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Toolset.  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'] === Toolset.__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["etag"] = state?.etag;
            resourceInputs["executionType"] = state?.executionType;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["openApiToolset"] = state?.openApiToolset;
            resourceInputs["project"] = state?.project;
            resourceInputs["toolsetId"] = state?.toolsetId;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.app === undefined && !opts.urn) {
                throw new Error("Missing required property 'app'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.toolsetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'toolsetId'");
            }
            resourceInputs["app"] = args?.app;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["executionType"] = args?.executionType;
            resourceInputs["location"] = args?.location;
            resourceInputs["openApiToolset"] = args?.openApiToolset;
            resourceInputs["project"] = args?.project;
            resourceInputs["toolsetId"] = args?.toolsetId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Toolset.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Toolset = Toolset;
/** @internal */
Toolset.__pulumiType = 'gcp:ces/toolset:Toolset';
//# sourceMappingURL=toolset.js.map