Skip to content

Commit

Permalink
lex/intent: Additional bits
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Jan 8, 2024
1 parent 8394578 commit d104c50
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
12 changes: 7 additions & 5 deletions internal/service/lexv2models/intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,21 @@ import (
// todo:
// x invalid result object
// x get basic test working
// x disappears
// x import/ID
// - test all attributes
// x update autoflex for StringEnum map keys
// - test all (reasonable number) attributes
// x tags (no tags on intents)
// - slot_priority on create
// x prompt_attempts_specification schema
// x prompt_attempts_specification model
// x prompt_attempts_specification test
// x intent-slots-slot-value-override schema
// x intent-slots-slot-value-override model
// - intent-slots-slot-value-override test
// x intent-slots-slot-value-override test
// x timeouts
// - get config with confirmation_setting.prompt_specification.prompt_attempts_specification working
// - updates
// x disappears

// @FrameworkResource(name="Intent")
func newResourceIntent(_ context.Context) (resource.ResourceWithConfigure, error) {
Expand Down Expand Up @@ -178,7 +180,7 @@ func (r *resourceIntent) Schema(ctx context.Context, req resource.SchemaRequest,
CustomType: fwtypes.NewListNestedObjectTypeOf[SlotValueOverride](ctx),
NestedObject: schema.NestedBlockObject{
Attributes: map[string]schema.Attribute{
flex.MapBlockKey: schema.StringAttribute{
"map_block_key": schema.StringAttribute{
Required: true,
// pattern: ^([0-9a-zA-Z][_-]?){1,100}$
},
Expand Down Expand Up @@ -378,7 +380,7 @@ func (r *resourceIntent) Schema(ctx context.Context, req resource.SchemaRequest,
CustomType: fwtypes.NewListNestedObjectTypeOf[PromptAttemptsSpecification](ctx),
NestedObject: schema.NestedBlockObject{
Attributes: map[string]schema.Attribute{
flex.MapBlockKey: schema.StringAttribute{
"map_block_key": schema.StringAttribute{
Required: true,
CustomType: fwtypes.StringEnumType[PromptAttemptsType](),
},
Expand Down
43 changes: 22 additions & 21 deletions internal/service/lexv2models/intent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,34 +1138,35 @@ resource "aws_lexv2models_intent" "test" {
message_selection_strategy = "Ordered"
prompt_attempts_specification {
Attempt1 {
allowed_input_types {
allow_audio_input = true
allow_dtmf_input = true
}
allow_interrupt = true
map_block_key = "Initial"
allowed_input_types {
allow_audio_input = true
allow_dtmf_input = true
}
audio_and_dtmf_input_specification {
start_timeout_ms = 1
allow_interrupt = true
audio_specification {
end_timeout_ms = 1
max_length_ms = 1
}
audio_and_dtmf_input_specification {
start_timeout_ms = 1
dtmf_specification {
deletion_character = "#"
end_character = "#"
end_timeout_ms = 1
max_length = 1
}
audio_specification {
end_timeout_ms = 1
max_length_ms = 1
}
text_input_specification {
start_timeout_ms = 1
dtmf_specification {
deletion_character = "#"
end_character = "#"
end_timeout_ms = 1
max_length = 1
}
}
text_input_specification {
start_timeout_ms = 1
}
}
}
}
Expand Down

0 comments on commit d104c50

Please sign in to comment.