Skip to content

Commit

Permalink
converting from TypeList to TypeSet
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecon committed Dec 24, 2024
1 parent 105aa3e commit 425b3aa
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 198 deletions.
2 changes: 1 addition & 1 deletion docs/resources/outbound_campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ resource "genesyscloud_outbound_campaign" "campaign" {
- `contact_list_filter_ids` (List of String) Filter to apply to the contact list before dialing. Currently a campaign can only have one filter applied.
- `contact_sorts` (Block List) The order in which to sort contacts for dialing, based on up to four columns. (see [below for nested schema](#nestedblock--contact_sorts))
- `division_id` (String) The division this campaign belongs to.
- `dnc_list_ids` (List of String) DncLists for this Campaign to check before placing a call.
- `dnc_list_ids` (Set of String) DncLists for this Campaign to check before placing a call.
- `dynamic_contact_queueing_settings` (Block List, Max: 1) Settings for dynamic queueing of contacts. (see [below for nested schema](#nestedblock--dynamic_contact_queueing_settings))
- `dynamic_line_balancing_settings` (Block List, Max: 1) Dynamic line balancing settings. (see [below for nested schema](#nestedblock--dynamic_line_balancing_settings))
- `edge_group_id` (String) The EdgeGroup that will place the calls. Required for all dialing modes except preview.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/outbound_messagingcampaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ resource "genesyscloud_outbound_messagingcampaign" "example_outbound_messagingca
- `contact_list_filter_ids` (List of String) The contact list filter to check before sending a message for this messaging campaign.
- `contact_sorts` (Block List) The order in which to sort contacts for dialing, based on up to four columns. (see [below for nested schema](#nestedblock--contact_sorts))
- `division_id` (String) The division this entity belongs to.
- `dnc_list_ids` (List of String) The dnc lists to check before sending a message for this messaging campaign.
- `dnc_list_ids` (Set of String) The dnc lists to check before sending a message for this messaging campaign.
- `dynamic_contact_queueing_settings` (Block List, Max: 1) Indicates (when true) that the campaign supports dynamic queueing of the contact list at the time of a request for contacts.
**Warning**: Updating this field will cause the campaign to be destroyed and re-created. (see [below for nested schema](#nestedblock--dynamic_contact_queueing_settings))
- `email_config` (Block List, Max: 1) Configuration for this messaging campaign to send Email messages. (see [below for nested schema](#nestedblock--email_config))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func ResourceOutboundMessagingCampaign() *schema.Resource {
`dnc_list_ids`: {
Description: `The dnc lists to check before sending a message for this messaging campaign.`,
Optional: true,
Type: schema.TypeList,
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
},
`campaign_status`: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func readOutboundMessagingcampaign(ctx context.Context, d *schema.ResourceData,
}

if sdkMessagingCampaign.DncLists != nil {
_ = d.Set("dnc_list_ids", util.SdkDomainEntityRefArrToList(*sdkMessagingCampaign.DncLists))
_ = d.Set("dnc_list_ids", util.SdkDomainEntityRefArrToSet(*sdkMessagingCampaign.DncLists))
}

log.Printf("Read Outbound Messaging Campaign %s", d.Id())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func readOutboundCampaign(ctx context.Context, d *schema.ResourceData, meta inte
resourcedata.SetNillableValue(d, "abandon_rate", campaign.AbandonRate)
resourcedata.SetNillableValue(d, "max_calls_per_agent", campaign.MaxCallsPerAgent)
if campaign.DncLists != nil {
_ = d.Set("dnc_list_ids", util.SdkDomainEntityRefArrToList(*campaign.DncLists))
_ = d.Set("dnc_list_ids", util.SdkDomainEntityRefArrToSet(*campaign.DncLists))
}
resourcedata.SetNillableReference(d, "callable_time_set_id", campaign.CallableTimeSet)
resourcedata.SetNillableReference(d, "call_analysis_response_set_id", campaign.CallAnalysisResponseSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource_genesycloud_outbound_campaign_schema.go holds four functions within it:
3. The datasource schema definitions for the outbound_campaign datasource.
4. The resource exporter configuration for the outbound_campaign exporter.
*/

const ResourceType = "genesyscloud_outbound_campaign"

// SetRegistrar registers all of the resources, datasources and exporters in the package
Expand Down Expand Up @@ -117,7 +118,7 @@ func ResourceOutboundCampaign() *schema.Resource {
`dnc_list_ids`: {
Description: `DncLists for this Campaign to check before placing a call.`,
Optional: true,
Type: schema.TypeList,
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
},
`callable_time_set_id`: {
Expand Down
Loading

0 comments on commit 425b3aa

Please sign in to comment.