Skip to content

Commit

Permalink
Adding readonly answer_options.id field to survey resource/exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecon committed Jul 22, 2024
1 parent 4f2cb61 commit 9cd70cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/resources/quality_forms_survey.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ Optional:

- `assistance_conditions` (Block Set) Options from which to choose an answer for this question. (see [below for nested schema](#nestedblock--question_groups--questions--answer_options--assistance_conditions))

Read-Only:

- `id` (String) The ID for the answer option.

<a id="nestedblock--question_groups--questions--answer_options--assistance_conditions"></a>
### Nested Schema for `question_groups.questions.answer_options.assistance_conditions`

Expand Down
14 changes: 10 additions & 4 deletions genesyscloud/resource_genesyscloud_quality_forms_survey.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ var (

surveyFormAnswerOptions = &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Description: "The ID for the answer option.",
Computed: true,
},
"text": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -211,9 +216,10 @@ func getAllSurveyForms(_ context.Context, clientConfig *platformclientv2.Configu

func SurveyFormExporter() *resourceExporter.ResourceExporter {
return &resourceExporter.ResourceExporter{
GetResourcesFunc: provider.GetAllWithPooledClient(getAllSurveyForms),
RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references
AllowZeroValues: []string{"question_groups.questions.answer_options.value"},
GetResourcesFunc: provider.GetAllWithPooledClient(getAllSurveyForms),
RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references
AllowZeroValues: []string{"question_groups.questions.answer_options.value"},
ExcludedAttributes: []string{"question_groups.questions.answer_options.id"},
}
}

Expand Down Expand Up @@ -569,7 +575,7 @@ func flattenSurveyQuestions(questions *[]platformclientv2.Surveyquestion) []inte
return nil
}

questionList := []interface{}{}
var questionList []interface{}

for _, question := range *questions {
questionMap := make(map[string]interface{})
Expand Down

0 comments on commit 9cd70cd

Please sign in to comment.