Skip to content

Commit

Permalink
Making Flow + Intent import respect is_default_X; fixing description …
Browse files Browse the repository at this point in the history
…on examples
  • Loading branch information
mmurakowski-verily committed Oct 24, 2023
1 parent f567fbf commit fffb255
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ if err != nil {
}
d.SetId(id)

// Set is_default_start_flow if the resource is actually the Default Start Flow
if d.Get("name").(string) == "00000000-0000-0000-0000-000000000000" {
d.Set("is_default_start_flow", true)
}

return []*schema.ResourceData{d}, nil
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@
}
d.SetId(id)

// Set is_default_X if the resource is actually a Default Intent
if d.Get("name").(string) == "00000000-0000-0000-0000-000000000000" {
d.Set("is_default_welcome_intent", true)
}
if d.Get("name").(string) == "00000000-0000-0000-0000-000000000001" {
d.Set("is_default_negative_intent", true)
}

return []*schema.ResourceData{d}, nil
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ resource "google_dialogflow_cx_flow" "<%= ctx[:primary_resource_id] %>" {
parent = google_dialogflow_cx_agent.agent.id
is_default_start_flow = true
display_name = "Default Start Flow"
description = "A start flow created along with the agent"

nlu_settings {
classification_threshold = 0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ resource "google_dialogflow_cx_flow" "default_start_flow" {
parent = google_dialogflow_cx_agent.agent.id
is_default_start_flow = true
display_name = "Default Start Flow"
description = "A start flow created along with the agent"
nlu_settings {
classification_threshold = 0.3
Expand Down

0 comments on commit fffb255

Please sign in to comment.