-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add sipConfig to ConversationProfile in Dialogflow #17537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -496,3 +496,96 @@ func testAccDialogflowConversationProfile_dialogflowRegional(context map[string] | |||||
| } | ||||||
| `, context) | ||||||
| } | ||||||
|
|
||||||
| func TestAccDialogflowConversationProfile_sipConfig(t *testing.T) { | ||||||
| t.Parallel() | ||||||
|
|
||||||
| randomSuffix := acctest.RandString(t, 10) | ||||||
|
|
||||||
| context := map[string]interface{}{ | ||||||
| "profile_name": "tf-test-dialogflow-profile-" + randomSuffix, | ||||||
| "random_suffix": randomSuffix, | ||||||
| } | ||||||
|
|
||||||
| acctest.VcrTest(t, resource.TestCase{ | ||||||
| PreCheck: func() { acctest.AccTestPreCheck(t) }, | ||||||
| ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the new field beta only field? If it is also available in GA API, the provider factory should be |
||||||
| CheckDestroy: testAccCheckDialogflowConversationProfileDestroyProducer(t), | ||||||
| Steps: []resource.TestStep{ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After each config step, can you add the import step? |
||||||
| { | ||||||
| Config: testAccDialogflowConversationProfile_sipConfigStep1(context), | ||||||
| }, | ||||||
| { | ||||||
| Config: testAccDialogflowConversationProfile_sipConfigStep2(context), | ||||||
| }, | ||||||
| { | ||||||
| Config: testAccDialogflowConversationProfile_sipConfigStep3(context), | ||||||
| }, | ||||||
| { | ||||||
| Config: testAccDialogflowConversationProfile_sipConfigStep4(context), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, | ||||||
| }, | ||||||
| }) | ||||||
| } | ||||||
|
|
||||||
| func testAccDialogflowConversationProfile_sipConfigStep1(context map[string]interface{}) string { | ||||||
| return acctest.Nprintf(` | ||||||
| resource "google_dialogflow_conversation_profile" "profile" { | ||||||
| provider = google-beta | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is also available in GA API, |
||||||
| display_name = "%{profile_name}" | ||||||
| location = "europe-west1" | ||||||
| language_code = "en-US" | ||||||
| } | ||||||
| `, context) | ||||||
| } | ||||||
|
|
||||||
| func testAccDialogflowConversationProfile_sipConfigStep2(context map[string]interface{}) string { | ||||||
| return acctest.Nprintf(` | ||||||
| resource "google_dialogflow_conversation_profile" "profile" { | ||||||
| provider = google-beta | ||||||
| display_name = "%{profile_name}" | ||||||
| location = "europe-west1" | ||||||
| language_code = "en-US" | ||||||
| sip_config { | ||||||
| create_conversation_on_the_fly = true | ||||||
| inactive_start = true | ||||||
| max_audio_recording_duration = "300s" | ||||||
| allow_virtual_agent_interaction = true | ||||||
| keep_conversation_running = true | ||||||
| copy_inbound_call_leg_headers = ["X-Header-1"] | ||||||
| ignore_reinvite_media_direction = true | ||||||
| } | ||||||
| } | ||||||
| `, context) | ||||||
| } | ||||||
|
|
||||||
| func testAccDialogflowConversationProfile_sipConfigStep3(context map[string]interface{}) string { | ||||||
| return acctest.Nprintf(` | ||||||
| resource "google_dialogflow_conversation_profile" "profile" { | ||||||
| provider = google-beta | ||||||
| display_name = "%{profile_name}" | ||||||
| location = "europe-west1" | ||||||
| language_code = "en-US" | ||||||
| sip_config { | ||||||
| create_conversation_on_the_fly = true | ||||||
| inactive_start = true | ||||||
|
Comment on lines
+570
to
+571
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| max_audio_recording_duration = "600s" | ||||||
| allow_virtual_agent_interaction = true | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keep_conversation_running = true | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| copy_inbound_call_leg_headers = ["X-Header-1", "X-Header-2"] | ||||||
| ignore_reinvite_media_direction = true | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bool fields can be removed to test their update and removal. |
||||||
| } | ||||||
| } | ||||||
| `, context) | ||||||
| } | ||||||
|
|
||||||
| func testAccDialogflowConversationProfile_sipConfigStep4(context map[string]interface{}) string { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is not needed, as it is the same with |
||||||
| return acctest.Nprintf(` | ||||||
| resource "google_dialogflow_conversation_profile" "profile" { | ||||||
| provider = google-beta | ||||||
| display_name = "%{profile_name}" | ||||||
| location = "europe-west1" | ||||||
| language_code = "en-US" | ||||||
| } | ||||||
| `, context) | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the API return the error message if
AUDIOENCODING_SPEEX_WITH_HEADER_BYTEis provided in the API request?