UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

298 lines (297 loc) • 11.7 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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/*&#47;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/*&#47;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}} * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: AnalysisRuleState, opts?: pulumi.CustomResourceOptions): AnalysisRule; /** * 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: any): obj is AnalysisRule; /** * If true, apply this rule to conversations. Otherwise, this rule is * inactive and saved as a draft. */ readonly active: pulumi.Output<boolean | undefined>; /** * Percentage of conversations that we should apply this analysis setting * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations * are sampled in a determenestic way. The original runtimePercentage & * upload percentage will be replaced by defining filters on the conversation. */ readonly analysisPercentage: pulumi.Output<number | undefined>; /** * Selector of all available annotators and phrase matchers to run. * Structure is documented below. */ readonly annotatorSelector: pulumi.Output<outputs.contactcenterinsights.AnalysisRuleAnnotatorSelector | undefined>; /** * Filter for the conversations that should apply this analysis * rule. An empty filter means this analysis rule applies to all * conversations. * Refer to https://cloud.google.com/contact-center/insights/docs/filtering * for details. */ readonly conversationFilter: pulumi.Output<string | undefined>; /** * Output only. The time at which this analysis rule was created. */ readonly createTime: pulumi.Output<string>; /** * Display Name of the analysis rule. */ readonly displayName: pulumi.Output<string | undefined>; /** * Location of the resource. */ readonly location: pulumi.Output<string>; /** * The resource name of the analysis rule. Randomly generated by Insights. */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Output only. The most recent time at which this analysis rule was updated. */ readonly updateTime: pulumi.Output<string>; /** * Create a AnalysisRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AnalysisRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AnalysisRule resources. */ export interface AnalysisRuleState { /** * If true, apply this rule to conversations. Otherwise, this rule is * inactive and saved as a draft. */ active?: pulumi.Input<boolean>; /** * Percentage of conversations that we should apply this analysis setting * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations * are sampled in a determenestic way. The original runtimePercentage & * upload percentage will be replaced by defining filters on the conversation. */ analysisPercentage?: pulumi.Input<number>; /** * Selector of all available annotators and phrase matchers to run. * Structure is documented below. */ annotatorSelector?: pulumi.Input<inputs.contactcenterinsights.AnalysisRuleAnnotatorSelector>; /** * Filter for the conversations that should apply this analysis * rule. An empty filter means this analysis rule applies to all * conversations. * Refer to https://cloud.google.com/contact-center/insights/docs/filtering * for details. */ conversationFilter?: pulumi.Input<string>; /** * Output only. The time at which this analysis rule was created. */ createTime?: pulumi.Input<string>; /** * Display Name of the analysis rule. */ displayName?: pulumi.Input<string>; /** * Location of the resource. */ location?: pulumi.Input<string>; /** * The resource name of the analysis rule. Randomly generated by Insights. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Output only. The most recent time at which this analysis rule was updated. */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a AnalysisRule resource. */ export interface AnalysisRuleArgs { /** * If true, apply this rule to conversations. Otherwise, this rule is * inactive and saved as a draft. */ active?: pulumi.Input<boolean>; /** * Percentage of conversations that we should apply this analysis setting * automatically, between [0, 1]. For example, 0.1 means 10%. Conversations * are sampled in a determenestic way. The original runtimePercentage & * upload percentage will be replaced by defining filters on the conversation. */ analysisPercentage?: pulumi.Input<number>; /** * Selector of all available annotators and phrase matchers to run. * Structure is documented below. */ annotatorSelector?: pulumi.Input<inputs.contactcenterinsights.AnalysisRuleAnnotatorSelector>; /** * Filter for the conversations that should apply this analysis * rule. An empty filter means this analysis rule applies to all * conversations. * Refer to https://cloud.google.com/contact-center/insights/docs/filtering * for details. */ conversationFilter?: pulumi.Input<string>; /** * Display Name of the analysis rule. */ displayName?: pulumi.Input<string>; /** * Location of the resource. */ location: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; }