@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
191 lines • 8.06 kB
JavaScript
;
// *** 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.AnalysisRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The CCAI Insights project wide analysis rule.
* This rule will be applied to all conversations that match the filter defined in the rule.
* For a conversation matches the filter, the annotators specified in the rule will be run.
* If a conversation matches multiple rules, a union of all the annotators will be run.
* One project can have multiple analysis rules.
*
* To get more information about AnalysisRule, see:
*
* * [API documentation](https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations.analysisRules)
* * How-to Guides
* * [Configure analysis rules using the API](https://cloud.google.com/contact-center/insights/docs/analysis-rule)
*
* ## Example Usage
*
* ### Contact Center Insights Analysis Rule Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const analysisRuleBasic = new gcp.contactcenterinsights.AnalysisRule("analysis_rule_basic", {
* location: "us-central1",
* displayName: "analysis-rule-display-name",
* });
* ```
* ### Contact Center Insights Analysis Rule Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const analysisRuleFull = new gcp.contactcenterinsights.AnalysisRule("analysis_rule_full", {
* location: "us-central1",
* displayName: "analysis-rule-display-name",
* conversationFilter: "agent_id = \"1\"",
* annotatorSelector: {
* runInterruptionAnnotator: false,
* issueModels: ["projects/1111111111111/locations/us-central1/issueModels/some_issue_model_id"],
* phraseMatchers: ["projects/1111111111111/locations/us-central1/phraseMatchers/123"],
* qaConfig: {
* scorecardList: {
* qaScorecardRevisions: ["projects/1111111111111/locations/us-central1/qaScorecards/*/revisions/some_scorecard_revision_id"],
* },
* },
* runEntityAnnotator: false,
* runIntentAnnotator: false,
* runIssueModelAnnotator: false,
* runPhraseMatcherAnnotator: false,
* runQaAnnotator: false,
* runSentimentAnnotator: false,
* runSilenceAnnotator: true,
* runSummarizationAnnotator: false,
* summarizationConfig: {
* summarizationModel: "BASELINE_MODEL",
* },
* },
* analysisPercentage: 0.5,
* active: true,
* });
* ```
* ### Contact Center Insights Analysis Rule Profile
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const analysisRuleProfile = new gcp.contactcenterinsights.AnalysisRule("analysis_rule_profile", {
* location: "us-central1",
* displayName: "analysis-rule-display-name",
* conversationFilter: "agent_id = \"1\"",
* annotatorSelector: {
* runInterruptionAnnotator: false,
* issueModels: ["projects/1111111111111/locations/us-central1/issueModels/some_issue_model_id"],
* phraseMatchers: ["projects/1111111111111/locations/us-central1/phraseMatchers/123"],
* qaConfig: {
* scorecardList: {
* qaScorecardRevisions: ["projects/1111111111111/locations/us-central1/qaScorecards/*/revisions/some_scorecard_revision_id"],
* },
* },
* runEntityAnnotator: false,
* runIntentAnnotator: false,
* runIssueModelAnnotator: false,
* runPhraseMatcherAnnotator: false,
* runQaAnnotator: false,
* runSentimentAnnotator: false,
* runSilenceAnnotator: true,
* runSummarizationAnnotator: false,
* summarizationConfig: {
* conversationProfile: "projects/1111111111111/locations/us-central1/conversationProfiles/some_conversation_profile",
* },
* },
* analysisPercentage: 0.5,
* active: true,
* });
* ```
*
* ## Import
*
* AnalysisRule can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/analysisRules/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, AnalysisRule can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:contactcenterinsights/analysisRule:AnalysisRule default projects/{{project}}/locations/{{location}}/analysisRules/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:contactcenterinsights/analysisRule:AnalysisRule default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:contactcenterinsights/analysisRule:AnalysisRule default {{location}}/{{name}}
* ```
*/
class AnalysisRule extends pulumi.CustomResource {
/**
* Get an existing AnalysisRule 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 AnalysisRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AnalysisRule. 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'] === AnalysisRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state?.active;
resourceInputs["analysisPercentage"] = state?.analysisPercentage;
resourceInputs["annotatorSelector"] = state?.annotatorSelector;
resourceInputs["conversationFilter"] = state?.conversationFilter;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["active"] = args?.active;
resourceInputs["analysisPercentage"] = args?.analysisPercentage;
resourceInputs["annotatorSelector"] = args?.annotatorSelector;
resourceInputs["conversationFilter"] = args?.conversationFilter;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AnalysisRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.AnalysisRule = AnalysisRule;
/** @internal */
AnalysisRule.__pulumiType = 'gcp:contactcenterinsights/analysisRule:AnalysisRule';
//# sourceMappingURL=analysisRule.js.map