Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions mmv1/products/dialogflow/ConversationProfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ parameters:
type: String
url_param_only: true
description: |
desc
The location of the conversation profile.
required: true
properties:
- name: 'name'
type: String
description: |
name
Identifier. The unique identifier of this conversation profile.
output: true
- name: 'displayName'
type: String
Expand Down Expand Up @@ -213,7 +213,7 @@ properties:
- type: NestedObject
name: 'sections'
description: |
he customized sections chosen to return when requesting a summary of a conversation.
The customized sections chosen to return when requesting a summary of a conversation.
properties:
- type: Array
name: 'sectionTypes'
Expand Down Expand Up @@ -243,7 +243,7 @@ properties:
name: 'agent'
required: true
description: |
he name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: projects/<Project ID>/locations/<Location ID>/agent.
The name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: projects/<Project ID>/locations/<Location ID>/agent.
- type: NestedObject
name: 'humanAgentSideConfig'
description: |
Expand Down Expand Up @@ -388,7 +388,7 @@ properties:
- type: NestedObject
name: 'sections'
description: |
he customized sections chosen to return when requesting a summary of a conversation.
The customized sections chosen to return when requesting a summary of a conversation.
properties:
- type: Array
name: 'sectionTypes'
Expand Down Expand Up @@ -444,7 +444,7 @@ properties:
name: 'agent'
required: true
description: |
he name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: projects/<Project ID>/locations/<Location ID>/agent.
The name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: projects/<Project ID>/locations/<Location ID>/agent.
- type: NestedObject
name: 'humanAgentSideConfig'
description: |
Expand Down Expand Up @@ -495,7 +495,7 @@ properties:
- type: NestedObject
name: 'messageAnalysisConfig'
description: |
desc
Configuration for analyzing conversation messages.
properties:
- type: Boolean
name: 'enableEntityExtraction'
Expand Down Expand Up @@ -600,7 +600,7 @@ properties:
- AUDIO_ENCODING_AMR
- AUDIO_ENCODING_AMR_WB
- AUDIO_ENCODING_OGG_OPUS
- AUDIOENCODING_SPEEX_WITH_HEADER_BYTE
Copy link
Copy Markdown
Member

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_BYTE is provided in the API request?

- AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE
- type: Integer
name: 'sampleRateHertz'
description: |
Expand All @@ -617,7 +617,7 @@ properties:
- type: Boolean
name: 'useTimeoutBasedEndpointing'
description: |
Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
Use timeout based endpointing, interpreting endpointer sensitivity as seconds of timeout value.
- type: String
name: 'languageCode'
description: |
Expand Down Expand Up @@ -672,6 +672,41 @@ properties:
- SSML_VOICE_GENDER_MALE
- SSML_VOICE_GENDER_FEMALE
- SSML_VOICE_GENDER_NEUTRAL
- type: NestedObject
name: 'sipConfig'
description: |
Configuration for SIP.
properties:
- type: Boolean
name: 'createConversationOnTheFly'
description: |
Asks Dialogflow Telephony to create the conversation provided in the SIP header on the fly when the call comes in.
- type: Boolean
name: 'inactiveStart'
description: |
Starts the conversation with inactive SDP directives
- type: String
name: 'maxAudioRecordingDuration'
description: |
Max duration for audio recording. Overrides the default value of 15 min. Max value is 8 hours.
- type: Boolean
name: 'allowVirtualAgentInteraction'
description: |
Allows interactions with a Dialogflow virtual agent even if the call is connected for SIPREC purposes.
- type: Boolean
name: 'keepConversationRunning'
description: |
Keeps the conversation running even if the call is disconnected.
- type: Array
name: 'copyInboundCallLegHeaders'
description: |
List of inbound call leg headers to be copied to outbound call legs created later.
item_type:
type: String
- type: Boolean
name: 'ignoreReinviteMediaDirection'
description: |
Ignores any media direction in the reINVITE SDP offer. Reuse the previous media direction.
- type: NestedObject
name: 'newRecognitionResultNotificationConfig'
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
resource "google_dialogflow_conversation_profile" "bidi_profile" {
provider = google-beta
display_name = "{{index $.Vars "profile_name"}}"
location = "global"
location = "europe-west1"
language_code = "en-US"
use_bidi_streaming = true
automated_agent_config {
agent = google_ces_app.ces_app_for_agent.id
}
sip_config {
allow_virtual_agent_interaction = true
create_conversation_on_the_fly = true
}
}

resource "google_ces_app" "ces_app_for_agent" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 ProtoV5ProviderFactories

CheckDestroy: testAccCheckDialogflowConversationProfileDestroyProducer(t),
Steps: []resource.TestStep{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Config: testAccDialogflowConversationProfile_sipConfigStep4(context),
Config: testAccDialogflowConversationProfile_sipConfigStep1(context),

},
},
})
}

func testAccDialogflowConversationProfile_sipConfigStep1(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_dialogflow_conversation_profile" "profile" {
provider = google-beta
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is also available in GA API, provider = google-beta is not needed.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
create_conversation_on_the_fly = true
inactive_start = true

max_audio_recording_duration = "600s"
allow_virtual_agent_interaction = true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
allow_virtual_agent_interaction = true

keep_conversation_running = true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
keep_conversation_running = true

copy_inbound_call_leg_headers = ["X-Header-1", "X-Header-2"]
ignore_reinvite_media_direction = true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ignore_reinvite_media_direction = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not needed, as it is the same with testAccDialogflowConversationProfile_sipConfigStep1

return acctest.Nprintf(`
resource "google_dialogflow_conversation_profile" "profile" {
provider = google-beta
display_name = "%{profile_name}"
location = "europe-west1"
language_code = "en-US"
}
`, context)
}
Loading