Skip to content
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

Feature/devtooling-1019 Bulk Contact Management within the Contact Lists resource #1506

Merged
merged 42 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
216cdf4
Init
bbbco Jan 8, 2025
e6fd222
Updates
bbbco Jan 9, 2025
ace6f6a
Updates
bbbco Jan 15, 2025
18c9b69
Use contactlist proxy for contact list contacts
bbbco Jan 16, 2025
20fd65e
It compiles!
bbbco Jan 17, 2025
7577f91
Merge branch 'dev' into feature/DEVTOOLING-1019
bbbco Jan 17, 2025
f11b4de
Add handling for exporting
bbbco Jan 17, 2025
4a61ab3
Address a few syntax issues
bbbco Jan 17, 2025
ed65a38
Some updates
bbbco Jan 17, 2025
1d147e5
It builds, compiles, and passes tests
bbbco Jan 21, 2025
1e57d4e
Merge branch 'dev' into feature/DEVTOOLING-1019
bbbco Jan 21, 2025
18da2da
Merge branch 'dev' into feature/DEVTOOLING-1019
bbbco Jan 22, 2025
3db08f0
Get export working
bbbco Jan 22, 2025
962fb98
Initial updates to merge resource into the contact list resource
bbbco Jan 23, 2025
fad679f
Refactor contact list resource to allow bulk uploads of contact list …
bbbco Jan 23, 2025
969cc1d
Updates to ensure valid CSV file is passed in
bbbco Jan 24, 2025
c5a3ad1
Remove superfoluous extra resource that has now been assimilated into…
bbbco Jan 24, 2025
cdd6c76
Remove exporter functionality from outbound_contact_list_contact reso…
bbbco Jan 24, 2025
7c02784
Support generating deprecated resource subcategories: https://develop…
bbbco Jan 24, 2025
4a8b593
Everything works with functional tests
bbbco Jan 24, 2025
e67dc4f
Trim whitespace tweak
bbbco Jan 24, 2025
5a51b84
Add retry functionality for export
bbbco Jan 24, 2025
82e5959
Merge branch 'dev' into feature/DEVTOOLING-1019v2
bbbco Jan 24, 2025
3ab33d3
Handle responses from downloadoropen() so they can be retried if 400
bbbco Jan 24, 2025
4fc9263
Amazon Q suggestions
bbbco Jan 25, 2025
0b6e643
Amazon Q updates
bbbco Jan 25, 2025
fbe9bb4
Amazon Q recommendations for documentation
bbbco Jan 25, 2025
50b12da
Fix perm issue
bbbco Jan 25, 2025
d259487
Amazon Q analysis
bbbco Jan 25, 2025
ef1e9d5
Extra comment
bbbco Jan 25, 2025
1c12039
Sleep a bit before retrying to export/download
bbbco Jan 25, 2025
5405465
Add export initiate/get retries
bbbco Jan 25, 2025
dccba09
Updates per PR
bbbco Jan 29, 2025
011fe8b
GetTestDataPath updates
bbbco Jan 29, 2025
9ee9553
Make test data organization more consistent
bbbco Jan 30, 2025
bce0de9
Merge branch 'dev' into feature/DEVTOOLING-1019v2
bbbco Jan 30, 2025
234b222
Harden some tests
bbbco Jan 31, 2025
97d2c87
Merge branch 'dev' into feature/DEVTOOLING-1019v2
bbbco Jan 31, 2025
5b1383b
Fix journey tests
bbbco Jan 31, 2025
9aa9455
Fix Journey tests
bbbco Jan 31, 2025
385e576
Journey test fix again
bbbco Feb 1, 2025
7280e94
Merge branch 'dev' into feature/DEVTOOLING-1019v2
bbbco Feb 6, 2025
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
11 changes: 8 additions & 3 deletions docs/resources/outbound_contact_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,28 @@ resource "genesyscloud_outbound_contact_list" "contact-list" {

### Required

- `column_names` (List of String) The names of the contact data columns. Changing the column_names attribute will cause the outboundcontact_list object to be dropped and recreated with a new ID
- `column_names` (List of String) The names of the contact data columns. Changing the column_names attribute will cause the outbound_contact_list object to be dropped and recreated with a new ID
- `name` (String) The name for the contact list.

### Optional

- `attempt_limit_id` (String) Attempt Limit for this ContactList.
- `automatic_time_zone_mapping` (Boolean) Indicates if automatic time zone mapping is to be used for this ContactList. Changing the automatic_time_zone_mappings attribute will cause the outboundcontact_list object to be dropped and recreated with a new ID
- `column_data_type_specifications` (Block List) The settings of the columns selected for dynamic queueing. If updated, the contact list is dropped and recreated with a new ID (see [below for nested schema](#nestedblock--column_data_type_specifications))
- `contacts_filepath` (String) The path to a CSV file containing contacts to import into the contact list. When updated, existing contacts will be removed and replaced with contacts from the new file. If not specified, an empty contact list will be created.
- `contacts_id_name` (String) The name of the column in the CSV file that contains the contact's unique contact id. If updated, the contact list is dropped and recreated with a new ID
- `division_id` (String) The division this entity belongs to.
- `email_columns` (Block Set) Indicates which columns are email addresses. Changing the email_columns attribute will cause the outboundcontact_list object to be dropped and recreated with a new ID. Required if phone_columns is empty (see [below for nested schema](#nestedblock--email_columns))
- `phone_columns` (Block Set) Indicates which columns are phone numbers. Changing the phone_columns attribute will cause the outboundcontact_list object to be dropped and recreated with a new ID. Required if email_columns is empty (see [below for nested schema](#nestedblock--phone_columns))
- `email_columns` (Block Set) Indicates which columns are email addresses. Changing the email_columns attribute will cause the outbound_contact_list object to be dropped and recreated with a new ID. Required if phone_columns is empty (see [below for nested schema](#nestedblock--email_columns))
- `phone_columns` (Block Set) Indicates which columns are phone numbers. Changing the phone_columns attribute will cause the outbound_contact_list object to be dropped and recreated with a new ID. Required if email_columns is empty (see [below for nested schema](#nestedblock--phone_columns))
- `preview_mode_accepted_values` (List of String) The values in the previewModeColumnName column that indicate a contact should always be dialed in preview mode.
- `preview_mode_column_name` (String) A column to check if a contact should always be dialed in preview mode.
- `trim_whitespace` (Boolean) Indicates if leading and trailing whitespace will be trimmed when importing a contactlist CSV file
- `zip_code_column_name` (String) The name of contact list column containing the zip code for use with automatic time zone mapping. Only allowed if 'automaticTimeZoneMapping' is set to true. Changing the zip_code_column_name attribute will cause the outboundcontact_list object to be dropped and recreated with a new ID

### Read-Only

- `contacts_file_content_hash` (String) The hash of the contacts file to import. This is retained as a computed value in the state in order to detect when a file's contents have changed.
- `contacts_record_count` (Number) The number of contacts in the contact list. This is a read-only attribute and sanity check
- `id` (String) The ID of this resource.

<a id="nestedblock--column_data_type_specifications"></a>
Expand Down
34 changes: 31 additions & 3 deletions docs/resources/outbound_contact_list_contact.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
page_title: "genesyscloud_outbound_contact_list_contact Resource - terraform-provider-genesyscloud"
subcategory: ""
subcategory: "Deprecated"
description: |-
Genesys Cloud Outbound Contact List Contact
[DEPRECATED] Genesys Cloud Outbound Contact List Contact
---
# genesyscloud_outbound_contact_list_contact (Resource)

Genesys Cloud Outbound Contact List Contact
[DEPRECATED] Genesys Cloud Outbound Contact List Contact

## API Usage
The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Client has been granted the necessary scopes and permissions to perform these operations:
Expand All @@ -16,6 +16,34 @@ The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Cl
- [PUT /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-outbound-contactlists--contactListId--contacts--contactId-)
- [DELETE /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#delete-api-v2-outbound-contactlists--contactListId--contacts--contactId-)

## Migrating from genesyscloud_outbound_contact_list_contact

### Deprecation Notice

The `genesyscloud_outbound_contact_list_contact` resource is deprecated and will be removed in a future version. Instead, use the `contacts_filepath` and `contacts_id_name` attributes in the `genesyscloud_outbound_contact_list` resource.

### Note About Exporter

The exporter functionality has been removed from this resource in favor of the `genesyscloud_outbound_contact_list` resource's built-in bulk handling of contacts via CSV exports. Contacts will now be exported within the CSV file output from the `genesyscloud_outbound_contact_list` and not be exported via this resource due to performance and scalability limitations with this resource.

### Migration Steps

1. Remove any `genesyscloud_outbound_contact_list_contact` resources from your Terraform configuration and add them to a `contacts.csv` file
2. Update your `genesyscloud_outbound_contact_list` resource to include:

```hcl
resource "genesyscloud_outbound_contact_list" "example" {
name = "Example Contact List"
# ... other existing configuration ...

contacts_filepath = "path/to/your/contacts.csv"
contacts_id_name = "contact_id_column"
}
```
3. Ensure your CSV file contains all required columns defined in `column_names`
4. Run `terraform plan` to verify the changes


## Example Usage

```terraform
Expand Down
17 changes: 14 additions & 3 deletions docs/resources/widget_deployment.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
page_title: "genesyscloud_widget_deployment Resource - terraform-provider-genesyscloud"
subcategory: ""
subcategory: "Deprecated"
description: |-
Genesys Cloud Widget Deployment
[DEPRECATED] Genesys Cloud Widget Deployment
---
# genesyscloud_widget_deployment (Resource)

Genesys Cloud Widget Deployment
[DEPRECATED] Genesys Cloud Widget Deployment

## API Usage
The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Client has been granted the necessary scopes and permissions to perform these operations:
Expand All @@ -17,6 +17,17 @@ The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Cl
* [PUT /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#put-api-v2-widgets-deployments--deploymentId-)
* [DELETE /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#delete-api-v2-widgets-deployments--deploymentId-)

## Migrating from genesyscloud_widget_deployment

### Deprecation Notice

The `genesyscloud_widget_deployment` resource is deprecated and will be removed in a future version due to this functionality being sunset in Genesys Cloud API.

### Migration Steps

1. Remove any `genesyscloud_widget_deployment` resources from your Terraform configuration.


## Example Usage

```terraform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
- [POST /api/v2/outbound/contactlists/{contactListId}/contacts](https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-outbound-contactlists--contactListId--contacts)
- [GET /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-outbound-contactlists--contactListId--contacts--contactId-)
- [PUT /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-outbound-contactlists--contactListId--contacts--contactId-)
- [DELETE /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#delete-api-v2-outbound-contactlists--contactListId--contacts--contactId-)
- [DELETE /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}](https://developer.genesys.cloud/devapps/api-explorer#delete-api-v2-outbound-contactlists--contactListId--contacts--contactId-)

## Migrating from genesyscloud_outbound_contact_list_contact

### Deprecation Notice

The `genesyscloud_outbound_contact_list_contact` resource is deprecated and will be removed in a future version. Instead, use the `contacts_filepath` and `contacts_id_name` attributes in the `genesyscloud_outbound_contact_list` resource.

### Note About Exporter

The exporter functionality has been removed from this resource in favor of the `genesyscloud_outbound_contact_list` resource's built-in bulk handling of contacts via CSV exports. Contacts will now be exported within the CSV file output from the `genesyscloud_outbound_contact_list` and not be exported via this resource due to performance and scalability limitations with this resource.

### Migration Steps

1. Remove any `genesyscloud_outbound_contact_list_contact` resources from your Terraform configuration and add them to a `contacts.csv` file
2. Update your `genesyscloud_outbound_contact_list` resource to include:

```hcl
resource "genesyscloud_outbound_contact_list" "example" {
name = "Example Contact List"
# ... other existing configuration ...

contacts_filepath = "path/to/your/contacts.csv"
contacts_id_name = "contact_id_column"
}
```
3. Ensure your CSV file contains all required columns defined in `column_names`
4. Run `terraform plan` to verify the changes
12 changes: 11 additions & 1 deletion examples/resources/genesyscloud_widget_deployment/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
* [GET /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#get-api-v2-widgets-deployments--deploymentId-)
* [POST /api/v2/widgets/deployments](https://developer.genesys.cloud/api/rest/v2/widgets/#post-api-v2-widgets-deployments)
* [PUT /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#put-api-v2-widgets-deployments--deploymentId-)
* [DELETE /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#delete-api-v2-widgets-deployments--deploymentId-)
* [DELETE /api/v2/widgets/deployments/{deploymentId}](https://developer.genesys.cloud/api/rest/v2/widgets/#delete-api-v2-widgets-deployments--deploymentId-)

## Migrating from genesyscloud_widget_deployment

### Deprecation Notice

The `genesyscloud_widget_deployment` resource is deprecated and will be removed in a future version due to this functionality being sunset in Genesys Cloud API.

### Migration Steps

1. Remove any `genesyscloud_widget_deployment` resources from your Terraform configuration.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (d *grammarLanguageDownloader) downloadFileData(fileType FileType) error {
func (d *grammarLanguageDownloader) downloadLanguageFileAndUpdateConfigMap(url string) error {
d.fileUrl = url
d.setExportFileName()
if err := files.DownloadExportFile(d.exportFilesFolderPath, d.exportFileName, d.fileUrl); err != nil {
if _, err := files.DownloadExportFile(d.exportFilesFolderPath, d.exportFileName, d.fileUrl); err != nil {
return err
}
d.updatePathsInExportConfigMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func ArchitectPromptAudioResolver(promptId, exportDirectory, subDirectory string

for _, data := range audioDataList {
log.Printf("Downloading file '%s' from mediaUri", path.Join(fullPath, data.FileName))
if err := files.DownloadExportFile(fullPath, data.FileName, data.MediaUri); err != nil {
if _, err := files.DownloadExportFile(fullPath, data.FileName, data.MediaUri); err != nil {
return err
}
log.Println("Successfully downloaded file")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func dataSourceOutboundContactListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
sdkConfig := m.(*provider.ProviderMeta).ClientConfig
proxy := getOutboundContactlistProxy(sdkConfig)
proxy := GetOutboundContactlistProxy(sdkConfig)
name := d.Get("name").(string)

return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError {
Expand Down
Loading